diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/eh/unwind1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/eh/unwind1.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/unwind1.C b/gcc/testsuite/g++.dg/eh/unwind1.C new file mode 100644 index 000000000..da7aa98fe --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/unwind1.C @@ -0,0 +1,25 @@ +// PR middle-end/28493 + +extern "C" void abort (); + +struct Command *ptr; + +struct Command { + Command() { ptr = this; } + virtual ~Command() { if (ptr != this) abort(); } +}; + +void tryfunc() +{ + Command cmd; + throw 1; +} + +int main() +{ + try + { + tryfunc(); + } + catch (int) { } +} |