summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr64280.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr64280.C')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr64280.C42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr64280.C b/gcc/testsuite/g++.dg/torture/pr64280.C
new file mode 100644
index 0000000000..6ea31481bd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr64280.C
@@ -0,0 +1,42 @@
+// { dg-do compile }
+
+class A
+{
+public:
+ A ();
+};
+class B
+{
+public:
+ B (int);
+ operator void *() { return m_fn1 () ? 0 : this; }
+ int m_fn1 ();
+};
+typedef int jmp_buf[];
+struct C
+{
+ jmp_buf cond_;
+};
+class F
+{
+ C what_;
+ bool m_fn2 ();
+};
+int _setjmp (int[]);
+void longjmp ();
+class D
+{
+public:
+ D () { longjmp (); }
+};
+bool
+F::m_fn2 ()
+{
+ B a (0);
+ if (a)
+ if (_setjmp (what_.cond_))
+ return 0;
+ else
+ D ();
+ A b;
+}