1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* 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 {};