summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/cleanup4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/eh/cleanup4.C')
-rw-r--r--gcc/testsuite/g++.dg/eh/cleanup4.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/cleanup4.C b/gcc/testsuite/g++.dg/eh/cleanup4.C
new file mode 100644
index 000000000..ba2d891c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/cleanup4.C
@@ -0,0 +1,17 @@
+// PR 16254
+// { dg-do compile }
+// We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A.
+
+struct A
+{
+ ~A ();
+ A (int);
+};
+
+int bar (const A &);
+
+void
+foo (int i)
+{
+ int format[1] = { bar (A (i)) };
+}