From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A82E3857365; Sat, 4 Feb 2023 17:02:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A82E3857365 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675530177; bh=btQetlAO3TGgG6aZ/7zh2/C+Ilu7M7Y6Snh78yaXqVs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Jp6qUgX6IoEiHEblV0LuALhaIULsJ/c0X9N1zbY12DXGO5BPc4IzzDB1sYGIf7oRz vJc543XGJpHay6Vk8QuJRDwgUpzlZBgCBdZloBc6zTLQyaQ1RoN20hrB9a1KR1i+WK s86SY/Kp6Mi+8bn2UHdoaKhUH7J19RVK891qIkXs= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107461] [12/13 Regression] ambiguity error for friend with templated constexpr argument Date: Sat, 04 Feb 2023 17:02:57 +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.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D107461 --- Comment #9 from Patrick Palka --- (In reply to Jakub Jelinek from comment #7) > Reduced testcase: Interestingly Clang also rejects this testcase, so I'm not sure if we were correct to accept it previously. Here's a more reduced testcase that seems clearly valid: template T foo (); template struct A { }; template struct B { template () (U()))>> static void bar(U); }; int main() { B b; B::bar(0); } : In function =E2=80=98int main()=E2=80=99: :12:23: error: no matching function for call to =E2=80=98B::bar(int)=E2=80=99 :7:15: note: candidate: =E2=80=98template static void B::bar(U) [with =3D U; T =3D void (*)(int)]=E2= =80=99 :7:15: note: template argument deduction/substitution failed: :6:54: error: expression cannot be used as a function If we remove the line #1 then this bogus error disappears.=