From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DD4643844028; Mon, 13 May 2024 13:53:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD4643844028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715608437; bh=RwaVGOLjLCckCwb/mEC+Oj9Ko6aw6z6ywdfgggjDdxA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P70vhkv6hIAe+m5jVzigT2Ol4oMb9avERTUnXeQ3RqRsbKwBuX8l+WZzraWyaLtcH BTC5yxkaEpIGlmwA69LHM/4dxf2QOSwvcCzAMUVnF0qbluuAfzaFyEorEBii2FRT+J VZkIOyikxTyS5yfTHU3BrAdSUCwyYh0ScUNkHAmE= 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 13:53: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 #5 from GCC Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:6d31a370e26eeb950c326332633b3e8e84b6630b commit r15-434-g6d31a370e26eeb950c326332633b3e8e84b6630b 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 =