https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80984
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Jun 22 11:12:43 2017 New Revision: 249509 URL: https://gcc.gnu.org/viewcvs?rev=249509&root=gcc&view=rev Log: Backported from mainline 2017-06-13 Jakub Jelinek <ja...@redhat.com> PR c++/80984 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in BLOCK_VARS (outer) chain. (cxx_omp_const_qual_no_mutable): Likewise. * g++.dg/opt/nrv18.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/nrv18.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/cp-gimplify.c branches/gcc-6-branch/gcc/testsuite/ChangeLog