From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-40137.protonmail.ch (mail-40137.protonmail.ch [185.70.40.137]) by sourceware.org (Postfix) with ESMTPS id 01ED63858408 for ; Tue, 26 Mar 2024 10:04:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01ED63858408 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=proton.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 01ED63858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.70.40.137 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711447492; cv=none; b=n9TRpPnBlTq6UGJejsibZeLX3TxzFL29rcUdA9ZS8cIzYUZA8fjDMwqILwHPTyimTWFFwRBrRW4ag3vUfwXWSyUk9cvhZdOgctY6NAdK4LO4JmZopE1TebP3QGImAMUkaptBOZNY18HnDy1bYacMddr7kn7dCpZgGGUeuXnkUag= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711447492; c=relaxed/simple; bh=mkNHqTzp2ADeXE/ONLlVg7CgzrWNtjmAsLfMGmVVxdc=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=OenEuLyv/KHuheztCZEAwlMpazCxWMJaZ6gWDZmqUsTbN3E7/E7eYQyMVDLq5LuFR+pU9LjciFatBJriWMtmN50e/+DbDfHsdY2q0Vw8vdNhpG1vjo2RxB9RZtUhPMc6dj9t/PJ3HPjdIgYvI2Aze22Qy/sFngeSlaRdG2MAXSg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1711447481; x=1711706681; bh=mkNHqTzp2ADeXE/ONLlVg7CgzrWNtjmAsLfMGmVVxdc=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=eZogQF9wrrZfKLWItjSOkckS9WSquFNXNoocHBoWpKmDughqWoc7UGjr08QxDrBfw SQ/eCfZeBYWqHoDB5FofPx3hfb6dkdv/31zgaD0FLOjWaZkZdop5YuxYsegrxr1koh Lx/I5mSpJoF0rMSUXZi75W+jEVSHD1poxHdXvcHrwtSdTARCH/bk+hL0fRrCFcU/Nd vZlrlp0Bx7vddP2rpJQ8SSB7O+8Py/sBY9bqqgJBwDrF5L1Slosbsy0j2Xr5Zlh9yr c0764WBOhikxvYuasPpEdOA6wxnO/QfkksFu3/B4MUDRUSHNWx55y+UiL8X73/zlf3 FOfKRA2/sTJZA== Date: Tue, 26 Mar 2024 10:04:24 +0000 To: "gcc-patches@gcc.gnu.org" From: centurion Subject: Re: [PATCH] c++: fix alias CTAD [PR114377] Message-ID: In-Reply-To: References: Feedback-ID: 105035476:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The problem was that in cp/pt.cc:find_template_parameter_info::found compil= er tried to get TEMPLATE_TEMPLATE_PARM tree from TEMPLATE_DECL tree by DECL= _INITIAL instead of TREE_TYPE(like for TYPE_DECL).Therefore, parm got nullp= tr, because cp/pt.cc:process_template_parm doesn't assign anything to DECL_= INITIAL for both TYPE_DECL and TEMPLATE_DECL. On Monday, March 25th, 2024 at 7:17 PM, centurion = wrote: > From b34312d82b236601c348382d30e625558f37d40c Mon Sep 17 00:00:00 2001 > From: centurion centurion009@proton.me >=20 > Date: Mon, 25 Mar 2024 01:57:21 +0400 > Subject: [PATCH] c++: fix alias CTAD [PR114377] >=20 > PR c++/114377 >=20 > gcc/cp/ChangeLog: >=20 > PR c++/114377 > * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for > TEMPLATE_DECL instead of DECL_INITIAL. >=20 > gcc/testsuite/ChangeLog: >=20 > * g++.dg/cpp2a/class-deduction-alias19.C: New test. > --- > gcc/cp/pt.cc | 3 ++- > .../g++.dg/cpp2a/class-deduction-alias19.C | 15 +++++++++++++++ > 2 files changed, 17 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C >=20 > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > index 8cf0d5b7a8d..d8a02f1cd7f 100644 > --- a/gcc/cp/pt.cc > +++ b/gcc/cp/pt.cc > @@ -11032,7 +11032,8 @@ find_template_parameter_info::found (tree parm) > { > if (TREE_CODE (parm) =3D=3D TREE_LIST) > parm =3D TREE_VALUE (parm); > - if (TREE_CODE (parm) =3D=3D TYPE_DECL) > + if (TREE_CODE (parm) =3D=3D TYPE_DECL > + || TREE_CODE(parm) =3D=3D TEMPLATE_DECL) > parm =3D TREE_TYPE (parm); > else > parm =3D DECL_INITIAL (parm); > diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C b/gcc/t= estsuite/g++.dg/cpp2a/class-deduction-alias19.C > new file mode 100644 > index 00000000000..1ea79bd7691 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C > @@ -0,0 +1,15 @@ > +// PR c++/114377 > +// { dg-do compile { target c++20 } } > + > +template