c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / inherit / covariant22.C
blob9826f9d01285e51cbbb0106cc43b1e9fc0a6007a
1 // PR c++/85068
2 // { dg-do compile }
4 struct A;
6 struct B
8   virtual A *foo ();    // { dg-message "overridden" }
9 };
11 struct C : virtual B
13   virtual C *foo ();    // { dg-error "invalid covariant return type for" }
16 struct D : C
18   virtual C *foo ();