aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1999-03-15 13:42:56 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-03-15 13:42:56 +0000
commit70c532b51d855ebd95407556598797406ec4b417 (patch)
tree958400a8e462ad02a1dae62d01cd94176f1da764 /gcc
parentc52016e41d746a0e01c304c3fdf3cab6746ded8f (diff)
downloadgcc-70c532b51d855ebd95407556598797406ec4b417.zip
gcc-70c532b51d855ebd95407556598797406ec4b417.tar.gz
gcc-70c532b51d855ebd95407556598797406ec4b417.tar.bz2
decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
* decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here. * tree.c (layout_basetypes): Not here. * search.c (dfs_search): Remove; no longer used. From-SVN: r25789
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/search.c39
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup9.C9
5 files changed, 22 insertions, 38 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c2b52d4..44fbf96 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2e7a94a7..88fec14 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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 ();
}
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 6583e69..0218b56 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -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)
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b93d9bd..126669f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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
index 0000000..2500400
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup9.C
@@ -0,0 +1,9 @@
+// Build don't link:
+
+struct S {
+ typedef long I;
+};
+
+struct D : virtual public S {
+ I i;
+};