From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41E503858425; Sun, 23 Jan 2022 03:19:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41E503858425 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104182] [12 Regression] Wrong code since r12-6329-g4f6bc28fc7dd86bd Date: Sun, 23 Jan 2022 03:19:13 +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.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: critical X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Sun, 23 Jan 2022 03:19:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104182 --- Comment #1 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:9718bc4b03c1a94f7cf64860bbc828aa53c56234 commit r12-6822-g9718bc4b03c1a94f7cf64860bbc828aa53c56234 Author: Jason Merrill Date: Sat Jan 22 17:11:54 2022 -0500 c++: array temporary at file scope [PR104182] This is the same issue as PR104031, but that patch doesn't fix this testcase because in this case, current_function_decl isn't set when we = get to cp_genericize_target_expr. But there seems to be no need for is_local_temp to check for function scope; !TREE_STATIC should be enoug= h. PR c++/104182 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing has set DECL_INITIAL on a TARGET_EXPR slot. * tree.cc (is_local_temp): Don't check DECL_CONTEXT. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist127.C: New test.=