* class.c, cp-tree.h, rtti.c: Remove com_interface attribute support.
* tree.c (cp_valid_lang_attribute): Warn about use of com_interface
attribute.
From-SVN: r42465
+2001-05-22 Jason Merrill <jason_merrill@redhat.com>
+
+ * class.c, cp-tree.h, rtti.c: Remove com_interface attribute support.
+ * tree.c (cp_valid_lang_attribute): Warn about use of com_interface
+ attribute.
+
2001-05-22 Joseph S. Myers <jsm28@cam.ac.uk>
* parse.y: Refer to compound literals as such, not as
TYPE_OVERLOADS_ARRAY_REF (t) |= TYPE_OVERLOADS_ARRAY_REF (basetype);
TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype);
TYPE_POLYMORPHIC_P (t) |= TYPE_POLYMORPHIC_P (basetype);
-
- /* Derived classes can implicitly become COMified if their bases
- are COM. */
- if (CLASSTYPE_COM_INTERFACE (basetype))
- CLASSTYPE_COM_INTERFACE (t) = 1;
- else if (i == 0 && CLASSTYPE_COM_INTERFACE (t))
- {
- cp_error
- ("COM interface type `%T' with non-COM leftmost base class `%T'",
- t, basetype);
- CLASSTYPE_COM_INTERFACE (t) = 0;
- }
}
}
basetype = BINFO_TYPE (binfo);
t = BINFO_TYPE (vid->rtti_binfo);
- /* For a COM object there is no RTTI entry. */
- if (CLASSTYPE_COM_INTERFACE (basetype))
- return;
-
/* To find the complete object, we will first convert to our most
primary base, and then add the offset in the vtbl to that value. */
b = binfo;
use a virtual thunk, as opposed to an ordinary thunk.
The BV_FN is the declaration for the virtual function itself.
- When CLASSTYPE_COM_INTERFACE_P does not hold, the first entry
- does not have a BV_FN; it is just an offset.
The BV_OVERRIDING_BASE is the binfo for the final overrider for
this function. (That binfo's BINFO_TYPE will always be the same
#define CLASSTYPE_NEARLY_EMPTY_P(NODE) \
(TYPE_LANG_SPECIFIC (NODE)->nearly_empty_p)
-/* Nonzero means that this type is meant for communication via COM. */
-#define CLASSTYPE_COM_INTERFACE(NODE) \
- (TYPE_LANG_SPECIFIC(NODE)->com_interface)
-
/* A list of class types of which this type is a friend. The
TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
case of a template friend. */
if (!TYPE_POLYMORPHIC_P (type))
return exp;
- if (CLASSTYPE_COM_INTERFACE (type))
- {
- cp_error ("RTTI not supported for COM interface type `%T'", type);
- return error_mark_node;
- }
/* If we don't have rtti stuff, get to a sub-object that does. */
if (!CLASSTYPE_VFIELDS (TREE_TYPE (TREE_TYPE (exp))))
if (! flag_rtti)
error ("taking dynamic typeid of object with -fno-rtti");
- if (CLASSTYPE_COM_INTERFACE (type))
- {
- cp_error ("RTTI not supported for COM interface type `%T'", type);
- return error_mark_node;
- }
/* If we don't have rtti stuff, get to a sub-object that does. */
if (! CLASSTYPE_VFIELDS (type))
}
if (is_attribute_p ("com_interface", attr_name))
{
- if (! flag_vtable_thunks)
- {
- error ("`com_interface' only supported with -fvtable-thunks");
- return 0;
- }
-
+ static int warned;
if (attr_args != NULL_TREE
|| decl != NULL_TREE
|| ! CLASS_TYPE_P (type)
return 0;
}
+ if (! warned++)
+ warning ("\
+`com_interface' is obsolete; g++ vtables are now COM-compatible by default");
return 1;
}
else if (is_attribute_p ("init_priority", attr_name))
+++ /dev/null
-// Test that we can use mixins with COM classes.
-
-struct A
-{
- virtual int foo () = 0;
- virtual int bar () = 0;
-} __attribute__((__com_interface__));
-
-struct B
-{
- virtual int baz () { return 5; }
-};
-
-struct C : public A, public B
-{
- int foo () { return 0; }
- int bar () { return 1; }
-};
-
-int main ()
-{
- C c;
- return c.foo ();
-}