From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 15DDE3870884; Tue, 25 Jun 2024 16:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15DDE3870884 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1719334780; bh=iMOaX2OaBNANSJf8TW4odAF4Qyhu35biAFsEfzILMK4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uuyV2b0dMl/dnYk60JutDNgA9QmDRzTn1H22LwOMP7+RFbOTMD40yNWMJTeUYUi8M 4mDB4QMTSpj//D9HQo4F88E5ZtBWD06I4rXNk8K2TP/d3sL94nmDjGv1RDjd1y2B3o bnUmFDRjHUVemOfO3xO25wsWf5SPPARctSS5DBdE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115198] Class template argument deduction fails for copy ctor when used with an alias template if the aliased class template has explicitly defaulted copy ctor Date: Tue, 25 Jun 2024 16:59:37 +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: 14.1.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: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.2 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=3D115198 --- Comment #5 from GCC Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:06ebb7c6f31fe42ffdea6f51ac1ba1f6b058c090 commit r15-1615-g06ebb7c6f31fe42ffdea6f51ac1ba1f6b058c090 Author: Patrick Palka Date: Tue Jun 25 12:59:24 2024 -0400 c++: alias CTAD and copy deduction guide [PR115198] Here we're neglecting to update DECL_NAME during the alias CTAD guide transformation, which causes copy_guide_p to return false for the transformed copy deduction guide since DECL_NAME is still __dguide_C with TREE_TYPE C but it should be __dguide_A with TREE_TYPE A (i.e. C). This ultimately results in ambiguity during overload resolution between the copy deduction guide vs copy ctor guide. This patch makes us update DECL_NAME of a transformed guide accordingly during alias/inherited CTAD. PR c++/115198 gcc/cp/ChangeLog: * pt.cc (alias_ctad_tweaks): Update DECL_NAME of the transformed guides. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias22.C: New test. Reviewed-by: Jason Merrill =