From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D38F63899067; Fri, 28 Jun 2024 21:14:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D38F63899067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1719609283; bh=59LVtcAXp7FE99kqiMU7DW/r7qmJtwCj7LzbyuGTefY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oqqSQGmukZeobNSX2ni21H7Ma8PNMBgdauoDP7UYAeBl4cz6S2Vl5Wnp/YQemNDH5 yZJUVWa7lsTdlxnDlZ1IcYzp2AiBi4McTfyWHup1YEWgFt8aToRJIWur1KWldJ800I IfxxiypyMy3CFuS72j9hcFxQrLG47ADOtNnUSDPw= 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: Fri, 28 Jun 2024 21:14:40 +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 #6 from GCC Commits --- The releases/gcc-14 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:a00a8d46ea6ff7130e2493e7bd9824e28e2509b7 commit r14-10358-ga00a8d46ea6ff7130e2493e7bd9824e28e2509b7 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 (cherry picked from commit 06ebb7c6f31fe42ffdea6f51ac1ba1f6b058c090)=