search.c (dependent_base_p): Don't compare a binfo to current_class_type; use the...
authorMark Mitchell <mark@markmitchell.com>
Tue, 25 Aug 1998 13:09:57 +0000 (13:09 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 25 Aug 1998 13:09:57 +0000 (13:09 +0000)
* 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
gcc/cp/search.c
gcc/testsuite/g++.old-deja/g++.pt/lookup4.C [new file with mode: 0644]

index 1fd7317..0af0407 100644 (file)
@@ -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>
index 6367358..4a1733c 100644 (file)
@@ -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 (file)
index 0000000..fe15252
--- /dev/null
@@ -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);
+}