aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2004-08-25 11:16:36 -0400
committerJason Merrill <jason@gcc.gnu.org>2004-08-25 11:16:36 -0400
commit905af9e968a904475e846afc73cc3cf07c5b359a (patch)
tree6217c93b085625d2f07fd2e7f8c0e797b601b4e0
parented89de94e600404a79c26669e91c55dbea674df6 (diff)
downloadgcc-905af9e968a904475e846afc73cc3cf07c5b359a.zip
gcc-905af9e968a904475e846afc73cc3cf07c5b359a.tar.gz
gcc-905af9e968a904475e846afc73cc3cf07c5b359a.tar.bz2
re PR c++/15461 (ICE due to NRV and inlining)
PR c++/15461 * semantics.c (nullify_returns_r): Replace a DECL_STMT for the NRV with an INIT_EXPR. From-SVN: r86552
-rw-r--r--gcc/testsuite/g++.dg/opt/nrv7.C13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/nrv7.C b/gcc/testsuite/g++.dg/opt/nrv7.C
new file mode 100644
index 0000000..c5034ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/nrv7.C
@@ -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();