diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-16 23:02:35 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-16 23:02:35 +0000 |
commit | fa5d8988596ba8af49805f52faea2419fe3eaba2 (patch) | |
tree | 1ada8b4322cb58084937c2086ecd64394a1249a7 /gcc/testsuite/g++.dg/eh | |
parent | c480bf2b1cce7c876d02ccddbfd39448e2c424b7 (diff) | |
download | gcc-fa5d8988596ba8af49805f52faea2419fe3eaba2.tar.gz |
PR middle-end/43365
* tree-eh.c (replace_goto_queue): Also replace in the eh_seq.
(lower_try_finally): Save and restore eh_seq around the expansion
of the try-finally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157499 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/eh')
-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 00000000000..32346d5018c --- /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; +} |