OSDN Git Service

* decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 1999 13:42:56 +0000 (13:42 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 1999 13:42:56 +0000 (13:42 +0000)
* tree.c (layout_basetypes): Not here.
* search.c (dfs_search): Remove; no longer used.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25789 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/search.c
gcc/cp/tree.c
gcc/testsuite/g++.old-deja/g++.other/lookup9.C [new file with mode: 0644]

index c2b52d4..44fbf96 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-15  Mark Mitchell  <mark@markmitchell.com>
+
+       * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
+       * tree.c (layout_basetypes): Not here.
+       * search.c (dfs_search): Remove; no longer used.
+       
 1999-03-12  Mark Mitchell  <mark@markmitchell.com>
 
        * decl2.c (validate_nonmember_using_decl): Issue sensible
index 2e7a94a..88fec14 100644 (file)
@@ -12536,6 +12536,10 @@ xref_basetypes (code_type_node, name, ref, binfo)
     CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (TREE_VEC_ELT (binfos, i)));
   CLEAR_CLASSTYPE_MARKED (ref);
 
+  /* Now that we know all the base-classes, set up the list of virtual
+     bases.  */
+  CLASSTYPE_VBASECLASSES (ref) = get_vbase_types (ref);
+
   pop_obstacks ();
 }
   
index 6583e69..0218b56 100644 (file)
@@ -2073,41 +2073,6 @@ convert_pointer_to_single_level (to_type, expr)
                           last, 1);
 }
 
-/* Like dfs_walk, but only walk until fn returns something, and return
-   that.  We also use the real vbase binfos instead of the placeholders
-   in the normal binfo hierarchy.  START is the most-derived type for this
-   hierarchy, so that we can find the vbase binfos.  */
-
-static tree
-dfs_search (binfo, fn, start)
-     tree binfo, start;
-     tree (*fn) PROTO((tree));
-{
-  tree binfos = BINFO_BASETYPES (binfo);
-  int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
-  tree retval;
-
-  for (i = 0; i < n_baselinks; i++)
-    {
-      tree base_binfo = TREE_VEC_ELT (binfos, i);
-
-      if (TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TYPE_PARM
-         || TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TEMPLATE_PARM)
-       /* Pass */;
-      else
-       {
-         if (TREE_VIA_VIRTUAL (base_binfo) && start)
-           base_binfo = binfo_member (BINFO_TYPE (base_binfo),
-                                      CLASSTYPE_VBASECLASSES (start));
-         retval = dfs_search (base_binfo, fn, start);
-         if (retval)
-           return retval;
-       }
-    }
-
-  return fn (binfo);
-}
-
 tree markedp (binfo, data) 
      tree binfo;
      void *data ATTRIBUTE_UNUSED;
@@ -3436,8 +3401,8 @@ dfs_bfv_queue_p (binfo, data)
   return binfo;
 }
 
-/* Passed to dfs_search by binfo_for_vtable; determine if bvtable comes
-   from BINFO.  */
+/* Passed to dfs_walk_real by binfo_for_vtable; determine if bvtable
+   comes from BINFO.  */
 
 static tree
 dfs_bfv_helper (binfo, data)
index b93d9bd..126669f 100644 (file)
@@ -640,7 +640,7 @@ layout_basetypes (rec, max)
      TREE_VALUE slot holds the virtual baseclass type.  Note that
      get_vbase_types makes copies of the virtual base BINFOs, so that
      the vbase_types are unshared.  */
-  CLASSTYPE_VBASECLASSES (rec) = vbase_types = get_vbase_types (rec);
+  vbase_types = CLASSTYPE_VBASECLASSES (rec);
 
   my_friendly_assert (TREE_CODE (TYPE_SIZE (rec)) == INTEGER_CST, 19970302);
   const_size = TREE_INT_CST_LOW (TYPE_SIZE (rec));
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup9.C b/gcc/testsuite/g++.old-deja/g++.other/lookup9.C
new file mode 100644 (file)
index 0000000..2500400
--- /dev/null
@@ -0,0 +1,9 @@
+// Build don't link:
+
+struct S {
+  typedef long I;
+};
+
+struct D : virtual public S {
+  I i;
+};