gcc/testsuite/g++.dg/compat/eh/unexpected1_x.C
raw| 1 | // { dg-options "-std=c++98" } |
| 2 | |
| 3 | #include <exception> |
| 4 | |
| 5 | struct One { }; |
| 6 | struct Two { }; |
| 7 | |
| 8 | extern "C" void abort (); |
| 9 | extern void doit (void) throw (Two); |
| 10 | extern void handle_unexpected (void); |
| 11 | |
| 12 | void |
| 13 | unexpected1_x () |
| 14 | { |
| 15 | std::set_unexpected (handle_unexpected); |
| 16 | |
| 17 | try |
| 18 | { |
| 19 | doit (); |
| 20 | } |
| 21 | catch (Two &) |
| 22 | { |
| 23 | } |
| 24 | catch (...) |
| 25 | { |
| 26 | abort (); |
| 27 | } |
| 28 | } |