1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
+ * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
+
+ * class.c (finish_base_struct): Allow non-COM bases for COM classes
+ except at the leftmost position.
+ (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
+ Pass the binfo's class, not the most derived, to skip_rtti_stuff.
+ * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
+
* tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
(build_cplus_new): Make sure that what we return is of the right type.
("COM interface type `%T' must be the leftmost base class",
basetype);
}
- else if (CLASSTYPE_COM_INTERFACE (t))
+ else if (CLASSTYPE_COM_INTERFACE (t) && i == 0)
{
cp_error ("COM interface type `%T' with non-COM base class `%T'",
t, basetype);
if (fndecl == NULL_TREE)
return;
- n = skip_rtti_stuff (&virtuals, t);
+ n = skip_rtti_stuff (&virtuals, BINFO_TYPE (binfo));
while (virtuals)
{
tree virtuals = BINFO_VIRTUALS (binfo);
unsigned HOST_WIDE_INT n;
- n = skip_rtti_stuff (&virtuals, t);
+ n = skip_rtti_stuff (&virtuals, BINFO_TYPE (binfo));
while (virtuals)
{
if (BINFO_NEW_VTABLE_MARKED (binfo))
choose = NEITHER;
- skip_rtti_stuff (&virtuals, t);
- skip_rtti_stuff (&old_virtuals, t);
+ skip_rtti_stuff (&virtuals, BINFO_TYPE (binfo));
+ skip_rtti_stuff (&old_virtuals, BINFO_TYPE (binfo));
while (virtuals)
{
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
- if (CLASS_TYPE_P (type))
+ if (CLASS_TYPE_P (type) && ! ANON_AGGR_TYPE_P (type))
{
/* Never let anything with uninheritable virtuals
make it through without complaint. */
{
tree virtuals = BINFO_VIRTUALS (vbases);
- skip_rtti_stuff (&virtuals, type);
+ skip_rtti_stuff (&virtuals, BINFO_TYPE (vbases));
while (virtuals)
{
*vbase_offsets = delta;
}
- n = skip_rtti_stuff (&virtuals, t);
+ n = skip_rtti_stuff (&virtuals, BINFO_TYPE (binfo));
while (virtuals)
{