testsuite: Add testcase for already fixed PR [PR94616]
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 May 2021 13:34:12 +0000 (15:34 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 May 2021 13:35:55 +0000 (15:35 +0200)
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/94616
* g++.dg/cpp0x/pr94616.C: New test.

gcc/testsuite/g++.dg/cpp0x/pr94616.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/pr94616.C b/gcc/testsuite/g++.dg/cpp0x/pr94616.C
new file mode 100644 (file)
index 0000000..a8fe700
--- /dev/null
@@ -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) {
+  }
+}