1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* PR c++/28253 This used to ICE. */ /* { dg-do compile } */ struct A { virtual A* foo(); }; struct B : virtual A { virtual B* foo(); /* { dg-error "overriding" } */ }; struct C : B { virtual C& foo(); /* { dg-error "conflicting return type" } */ };