gcc/testsuite/g++.old-deja/g++.mike/eh28.C
raw| 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 |
| 12 | main() |
| 13 | { |
| 14 | try { Y y; throw y; } |
| 15 | catch (X& x) { x.p(); } |
| 16 | catch (...) { } |
| 17 | return fail; |
| 18 | } |