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 00000000000..ba15d96762d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/defarg5.C @@ -0,0 +1,20 @@ +// Bug: the SAVE_EXPR in the new expression remembers that it's in g(), +// causing the compiler to crash in h(). + +// Build don't link: + +struct A { + A (); +}; + +void f (A* = new A); + +void g () +{ + f (); +} + +void h () +{ + f (); +}