From bca9e8f7ccd1d094933d902efdb9f59e032d0c91 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 25 Aug 1998 13:09:57 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/search.c | 2 +- gcc/testsuite/g++.old-deja/g++.pt/lookup4.C | 24 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/lookup4.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1fd7317112b..0af040726e7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-08-25 Mark Mitchell + * 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 diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 6367358ba78..4a1733c4dd7 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 00000000000..fe152526b69 --- /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 i {}; + +struct B +{ + int i; +}; + +template +struct D : public B +{ + void f(); + void g() { h(i); } +}; + +template +void D::f() +{ + h(i); +}