aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-05-22 15:42:30 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-05-22 15:42:30 -0400
commit0401d4997a27f495b52e2a5af5f172fc10cf9a1b (patch)
treea6c71baab918f558fc7349ea894a709dbd762e5a /gcc
parent766a4175b12e77540da5a39482d1cd3e4beb81ff (diff)
downloadgcc-0401d4997a27f495b52e2a5af5f172fc10cf9a1b.zip
gcc-0401d4997a27f495b52e2a5af5f172fc10cf9a1b.tar.gz
gcc-0401d4997a27f495b52e2a5af5f172fc10cf9a1b.tar.bz2
class.c, [...]: Remove com_interface attribute support.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/class.c16
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/rtti.c10
-rw-r--r--gcc/cp/tree.c10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/comint1.C24
6 files changed, 10 insertions, 62 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 241b2c3..956d017 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 4566200..eca199f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1690,18 +1690,6 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
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;
- }
}
}
@@ -7993,10 +7981,6 @@ build_rtti_vtbl_entries (binfo, vid)
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;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 91e723b..e5065e4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -132,8 +132,6 @@ Boston, MA 02111-1307, USA. */
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
@@ -1578,10 +1576,6 @@ struct lang_type
#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. */
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 1ce8f98..d798f63 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -122,11 +122,6 @@ build_headof (exp)
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))))
@@ -222,11 +217,6 @@ get_tinfo_decl_dynamic (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))
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 65ba7f6..2dfc567 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2236,12 +2236,7 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, 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)
@@ -2251,6 +2246,9 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, 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))
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/comint1.C b/gcc/testsuite/g++.old-deja/g++.ext/comint1.C
deleted file mode 100644
index 78d99e6..0000000
--- a/gcc/testsuite/g++.old-deja/g++.ext/comint1.C
+++ /dev/null
@@ -1,24 +0,0 @@
-// 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 ();
-}