1 // PR c++/46526 2 // { dg-do run { target c++11 } } 3 4 struct Base 5 { 6 virtual int getid () = 0; 7 }; 8 9 struct A : public Base 10 { getidA11 virtual int getid () { return 1; } 12 }; 13 14 struct B : public Base 15 { getidB16 virtual int getid () { throw "here"; } 17 }; 18 19 int main()20main () 21 { 22 A a; 23 B b; 24 Base& ar = a; 25 ar.getid (); 26 } 27