1 2 3 4 5 6 7 8 9 10 11 12 13 14
// { dg-do assemble } // g++ ought to warn about casting a base pointer to a derived reference. struct A { virtual void f () = 0; }; struct B: public A { void f () { } }; int main() { B* bp; A& ar = (A&)bp; // { dg-warning "" } }