gcc/testsuite/g++.dg/eh/unwind1.C
raw| 1 | // PR middle-end/28493 |
| 2 | |
| 3 | extern "C" void abort (); |
| 4 | |
| 5 | struct Command *ptr; |
| 6 | |
| 7 | struct Command { |
| 8 | Command() { ptr = this; } |
| 9 | virtual ~Command() { if (ptr != this) abort(); } |
| 10 | }; |
| 11 | |
| 12 | void tryfunc() |
| 13 | { |
| 14 | Command cmd; |
| 15 | throw 1; |
| 16 | } |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | try |
| 21 | { |
| 22 | tryfunc(); |
| 23 | } |
| 24 | catch (int) { } |
| 25 | } |