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