From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CC6C3858C56; Mon, 28 Mar 2022 18:17:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CC6C3858C56 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105064] [10/11/12 Regression] requires crashes gcc Date: Mon, 28 Mar 2022 18:17:16 +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: 11.2.0 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: 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: Mon, 28 Mar 2022 18:17:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105064 --- Comment #11 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:ecb4882e362e80a1bf172453ac9b366edbb4e89c commit r12-7860-gecb4882e362e80a1bf172453ac9b366edbb4e89c Author: Patrick Palka Date: Mon Mar 28 14:15:16 2022 -0400 c++: constrained template friend matching ICE [PR105064] Here during declaration matching for the two constrained template friends, we crash from maybe_substitute_reqs_for because the second friend doesn't yet have DECL_TEMPLATE_INFO set (we're being called indirectly from push_template_decl). As far as I can tell, this situation happens only when declaring a constrained template friend within a non-template class (as in the testcase), in which case the substitution would be a no-op anyway. So this patch rearranges maybe_substitute_reqs_for to gracefully handle missing DECL_TEMPLATE_INFO by just skipping the substitution. PR c++/105064 gcc/cp/ChangeLog: * constraint.cc (maybe_substitute_reqs_for): Don't assume DECL_TEMPLATE_INFO is available. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-friend9.C: New test.=