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
This commit is contained in:
parent
c52016e41d
commit
70c532b51d
@ -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
|
||||
|
@ -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 ();
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
|
9
gcc/testsuite/g++.old-deja/g++.other/lookup9.C
Normal file
9
gcc/testsuite/g++.old-deja/g++.other/lookup9.C
Normal file
@ -0,0 +1,9 @@
|
||||
// Build don't link:
|
||||
|
||||
struct S {
|
||||
typedef long I;
|
||||
};
|
||||
|
||||
struct D : virtual public S {
|
||||
I i;
|
||||
};
|
Loading…
Reference in New Issue
Block a user