// { dg-do run } // Origin: Mark Mitchell struct B { B (); virtual void f () = 0; }; B::B () { } extern B* bp; template struct C : public B { virtual void f () { } }; template struct D : public B { virtual void f () { bp = new C; } }; B* bp = new D; int main () { bp->f (); bp->f (); }