re PR c++/15461 (ICE due to NRV and inlining)
authorJason Merrill <jason@gcc.gnu.org>
Wed, 25 Aug 2004 15:16:36 +0000 (11:16 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 25 Aug 2004 15:16:36 +0000 (11:16 -0400)
        PR c++/15461
        * semantics.c (nullify_returns_r): Replace a DECL_STMT
        for the NRV with an INIT_EXPR.

From-SVN: r86552

gcc/testsuite/g++.dg/opt/nrv7.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/opt/nrv7.C b/gcc/testsuite/g++.dg/opt/nrv7.C
new file mode 100644 (file)
index 0000000..c5034ec
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/15461
+
+struct A {  
+    int i;  
+};  
+  
+inline A foo () {  
+    int j = 1; 
+    A a = { j }; 
+    return a;  
+} 
+A tv = foo();