diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-08-25 13:09:57 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-08-25 13:09:57 +0000 |
commit | bca9e8f7ccd1d094933d902efdb9f59e032d0c91 (patch) | |
tree | 5d8d8d96272b22955c935791bb6b14234754242b | |
parent | 226c39d3902bcb038dfb82998e414223d5df94ec (diff) | |
download | gcc-bca9e8f7ccd1d094933d902efdb9f59e032d0c91.zip gcc-bca9e8f7ccd1d094933d902efdb9f59e032d0c91.tar.gz gcc-bca9e8f7ccd1d094933d902efdb9f59e032d0c91.tar.bz2 |
search.c (dependent_base_p): Don't compare a binfo to current_class_type; use the TREE_TYPE of the binfo instead.
* search.c (dependent_base_p): Don't compare a binfo to
current_class_type; use the TREE_TYPE of the binfo instead.
From-SVN: r21971
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/lookup4.C | 24 |
3 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1fd7317..0af0407 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-08-25 Mark Mitchell <mark@markmitchell.com> + * search.c (dependent_base_p): Don't compare a binfo to + current_class_type; use the TREE_TYPE of the binfo instead. + * cp-tree.h (CLASS_TYPE_P): Revise definition. 1998-08-25 Jason Merrill <jason@yorick.cygnus.com> diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 6367358..4a1733c 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -3488,7 +3488,7 @@ dependent_base_p (binfo) { for (; binfo; binfo = BINFO_INHERITANCE_CHAIN (binfo)) { - if (binfo == current_class_type) + if (TREE_TYPE (binfo) == current_class_type) break; if (uses_template_parms (TREE_TYPE (binfo))) return 1; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lookup4.C b/gcc/testsuite/g++.old-deja/g++.pt/lookup4.C new file mode 100644 index 0000000..fe15252 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lookup4.C @@ -0,0 +1,24 @@ +// Build don't link: + +void h(int); + +template <class T> +class i {}; + +struct B +{ + int i; +}; + +template <class T> +struct D : public B +{ + void f(); + void g() { h(i); } +}; + +template <class T> +void D<T>::f() +{ + h(i); +} |