From: Jakub Jelinek Date: Fri, 14 May 2021 13:34:12 +0000 (+0200) Subject: testsuite: Add testcase for already fixed PR [PR94616] X-Git-Tag: upstream/12.2.0~7897 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cafe627d6c8bce7e7f46bdbdef3d14e9701ce9d;p=platform%2Fupstream%2Fgcc.git testsuite: Add testcase for already fixed PR [PR94616] 2021-05-14 Jakub Jelinek PR c++/94616 * g++.dg/cpp0x/pr94616.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp0x/pr94616.C b/gcc/testsuite/g++.dg/cpp0x/pr94616.C new file mode 100644 index 0000000..a8fe700 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr94616.C @@ -0,0 +1,23 @@ +// PR c++/94616 +// { dg-do compile { target c++11 } } + +struct Bar { + Bar(int n) { if (n > 0) throw 2; } + ~Bar() {} +}; + +struct Foo { + Bar b1 = 0; + Bar b2 = 1; + Foo() {} + ~Foo() {} +}; + +int +main() +{ + try { + Foo f; + } catch(int) { + } +}