+2007-01-23 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/27492
+ * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
+ function decls.
+
2007-01-23 Ian Lance Taylor <iant@google.com>
* typeck.c (convert_for_assignment): Only warn about a = b = c
DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl);
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
+ DECL_INVALID_OVERRIDER_P (newdecl) |= DECL_INVALID_OVERRIDER_P (olddecl);
DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl);
if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK)
SET_OVERLOADED_OPERATOR_CODE
+2007-01-23 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/27492
+ * g++.dg/inherit/covariant15.C: New test.
+
2007-01-23 Ian Lance Taylor <iant@google.com>
* g++.dg/warn/Wparentheses-24.C: New test.
--- /dev/null
+/* This used to ICE (PR c++/27492) */
+/* { dg-do "compile" } */
+
+struct A {};
+
+class B : A
+{
+ virtual A* foo(); /* { dg-error "overriding" } */
+};
+
+struct C : virtual B
+{
+ virtual C* foo(); /* { dg-error "invalid covariant return type" } */
+};
+
+C* C::foo() { return 0; }
+
+struct D : C {};