diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/eh/pr43365.C')
-rw-r--r-- | gcc/testsuite/g++.dg/eh/pr43365.C | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/pr43365.C b/gcc/testsuite/g++.dg/eh/pr43365.C new file mode 100644 index 000000000..32346d501 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/pr43365.C @@ -0,0 +1,30 @@ +extern "C" void abort(); + +class Counter +{ +public: + static int count; + ~Counter() { count += 1; } +}; + +int Counter::count = 0; + +void func() +{ + Counter c; + + try { + throw 1; + } + catch (const int&) { + return; + } +} + +int main() +{ + func(); + if (Counter::count != 1) + abort(); + return 0; +} |