From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CEF439724B5; Fri, 1 May 2020 17:15:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CEF439724B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588353354; bh=BWth1uyYagPRSaITB/IVCjGrFEq6+3Ty3x5hV6Wk4R0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f6UjycTtgR/En5dVva+/qjeP0tva4tpy5w60ETK/H9YGOSKoq3H3slt4h4JIfTblt txFZ/XnJeTrEP0dhew8MGKeTTcq7adRush4rv/LGWytO6A9TdvRp43UaLlwKfNTyJ0 cckdQek4mt2Qsumumvw9Nxmsj1Fkc2j9WR4qohA4= From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/91133] [8/9/10/11 Regression] Wrong "partial specialization is not more specialized than" error Date: Fri, 01 May 2020 17:15:53 +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: 9.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2020 17:15:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91133 --- Comment #4 from Jason Merrill --- This is really a question of partial ordering; determining whether the part= ial specialization is more specialized than the primary class template is equivalent to this testcase: template struct Id { typedef T type; }; template struct A {}; template void f(A); // #1 template::type X> void f(A); // #2 int main() { f(A()); // is #2 more specialized? } This was rejected as ambiguous by GCC going back at least to 4.1. It is al= so rejected by EDG/icc. It is accepted by clang and msvc, like the original testcase. The issue is with the partial ordering deduction of #1 from #2: we deduce i= nt for U from the second argument, and Id::type for U from the third argume= nt, and those don't agree, so deduction for the third argument fails in both directions, and the functions are ambiguous. This is related to open core issues 455 and 1337. I don't know what rationale clang/msvc are using to conclude that #2 is more specialized.=