From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE6153838022; Thu, 7 Apr 2022 19:19:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE6153838022 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104565] [10/11 Regression] constexpr template goes wrong with class and call to constexpr method Date: Thu, 07 Apr 2022 19:19:28 +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: 10.0 X-Bugzilla-Keywords: rejects-valid 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: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 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: Thu, 07 Apr 2022 19:19:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104565 --- Comment #7 from CVS Commits --- The releases/gcc-11 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:c0f38a14c8e9daf4c3f96fe9de4e9785616d5912 commit r11-9795-gc0f38a14c8e9daf4c3f96fe9de4e9785616d5912 Author: Patrick Palka Date: Thu Feb 17 08:35:23 2022 -0500 c++: double non-dep folding from finish_compound_literal [PR104565] In finish_compound_literal, we perform non-dependent expr folding before the call to check_narrowing ever since r9-5973. But ever since r10-709= 6, check_narrowing also performs non-dependent expr folding of its own. This double folding means tsubst will see non-templated trees during the second folding, which causes a spurious error in the below testcase. This patch removes the former folding operation; it seems obviated by the latter one. PR c++/104565 gcc/cp/ChangeLog: * semantics.c (finish_compound_literal): Don't perform non-dependent expr folding before calling check_narrowing. gcc/testsuite/ChangeLog: * g++.dg/template/non-dependent22.C: New test. (cherry picked from commit 6bbd8afee0036c274f5ebb5b48d6fdc2091bd046)=