summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/defarg5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/defarg5.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg5.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg5.C b/gcc/testsuite/g++.old-deja/g++.other/defarg5.C
new file mode 100644
index 000000000..9b294766f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg5.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Bug: the SAVE_EXPR in the new expression remembers that it's in g(),
+// causing the compiler to crash in h().
+
+
+struct A {
+ A ();
+};
+
+void f (A* = new A);
+
+void g ()
+{
+ f ();
+}
+
+void h ()
+{
+ f ();
+}