From: Jason Merrill Date: Wed, 25 Aug 2004 15:16:36 +0000 (-0400) Subject: re PR c++/15461 (ICE due to NRV and inlining) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=905af9e968a904475e846afc73cc3cf07c5b359a;p=gcc.git 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 --- diff --git a/gcc/testsuite/g++.dg/opt/nrv7.C b/gcc/testsuite/g++.dg/opt/nrv7.C new file mode 100644 index 00000000000..c5034ecc0f2 --- /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();