1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } } 2 // { dg-options "-fexceptions" } 3 4 #include <typeinfo> 5 6 int fail = 1; 7 p()8class X { public: virtual void p() { } }; p()9class Y : public X { public: virtual void p() { fail = 0; } }; 10 main()11int main() 12 { 13 try { Y y; throw y; } 14 catch (X& x) { x.p(); } 15 catch (...) { } 16 return fail; 17 } 18