From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 789113858D1E; Tue, 26 Jul 2022 03:12:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 789113858D1E From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106230] [12 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d Date: Tue, 26 Jul 2022 03:12:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 03:12:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106230 --- Comment #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Jason Merrill : https://gcc.gnu.org/g:60954a06ceb1598d86763e5504d8e1b874b6bd6a commit r12-8618-g60954a06ceb1598d86763e5504d8e1b874b6bd6a Author: Jason Merrill Date: Mon Jul 25 11:13:31 2022 -0400 c++: aggregate prvalue as for range [PR106230] Since my PR94041 work on temporary lifetime in aggregate initialization= , we end up calling build_vec_init to initialize the reference-extended temporary for the artificial __for_range variable. And build_vec_init uses finish_for_stmt to implement its loop. That function assumes that if __for_range is in current_binding_level, we're finishing a range-for, a= nd we should fix up the variable as it goes out of scope. But when called fr= om build_vec_init we aren't finishing a range-for, and do_poplevel doesn't remove the variable from scope because stmts_are_full_exprs_p is false.= So let's check that here as well, and leave the DECL_NAME alone. PR c++/106230 gcc/cp/ChangeLog: * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/range-for38.C: New test.=