From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58ED1387093A; Mon, 13 May 2024 15:39:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58ED1387093A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715614797; bh=VC8sDUJEBXuA9HieDXUALZRGy6GWSTl1zgWHz0mnq7Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nKgrGFETCvYfCJLu3labyhaFZ9Mm7RTLz6krWgDunsJdxT+14fc8HdxdZDP7+8GgX 34IhOFt4NmqO7p8QOcKiya7NeNWEOSWnqkMnhN5SlxmU6Dy1LyxZqUg5aBVqyOAGrv Kdf8fbU4Q6/6tXqOdyf8Y1c5O0LQ7zdcyfoNQlm0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114901] GCC internal_error on CTAD alias Date: Mon, 13 May 2024 15:39:56 +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: 13.2.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: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114901 --- Comment #6 from GCC Commits --- The releases/gcc-14 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:57cd8665fea4c339369a43be017583621aa82fed commit r14-10201-g57cd8665fea4c339369a43be017583621aa82fed Author: Patrick Palka Date: Mon May 13 09:53:40 2024 -0400 c++: nested aggregate/alias CTAD fixes [PR114974, PR114901, PR114903] During maybe_aggr_guide with a nested class template and paren init, like with list init we need to consider the generic template type rather than the partially instantiated type since partial instantiations don't have (partially instantiated) TYPE_FIELDS. In turn we need to partially substitute PARMs in the paren init case as well. As a drive-by improve= ment it seems better to use outer_template_args instead of DECL_TI_ARGS duri= ng this partial substitution so that we lower instead of substitute the innermost template parameters, which is generally more robust. And during alias_ctad_tweaks with a nested class template, even though the guides may be already partially instantiated we still need to substitute the outermost arguments into its constraints. PR c++/114974 PR c++/114901 PR c++/114903 gcc/cp/ChangeLog: * pt.cc (maybe_aggr_guide): Fix obtaining TYPE_FIELDS in the paren init case. Hoist out partial substitution logic to apply to the paren init case as well. (alias_ctad_tweaks): Substitute outer template arguments into a guide's constraints. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-aggr14.C: New test. * g++.dg/cpp2a/class-deduction-alias20.C: New test. * g++.dg/cpp2a/class-deduction-alias21.C: New test. Reviewed-by: Jason Merrill (cherry picked from commit 6d31a370e26eeb950c326332633b3e8e84b6630b)=