summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/PR58294.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/PR58294.C')
-rw-r--r--gcc/testsuite/g++.dg/torture/PR58294.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/PR58294.C b/gcc/testsuite/g++.dg/torture/PR58294.C
new file mode 100644
index 00000000000..e1fb95ae23d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/PR58294.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+struct A {
+ virtual ~A();
+ virtual void m_fn1() { delete this; }
+ void m_fn2() { m_fn1(); }
+};
+
+struct B {
+ A *pi_;
+ B() { pi_->m_fn2(); }
+};
+struct C {
+ B pn;
+};
+void _setjmp();
+int png_decode() {
+ _setjmp();
+ C a;
+ return 0;
+}