From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4A42B385780D; Thu, 7 Apr 2022 15:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A42B385780D From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/91618] [9/10/11/12 Regression] template-id required to friend a function template, even for a qualified-id Date: Thu, 07 Apr 2022 15:59:39 +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: 10.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Thu, 07 Apr 2022 15:59:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91618 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #11 from Jason Merrill --- Interesting, seems that G++ never implemented that bullet. Even though we allowed the friend declaration, it didn't match the template: template int f(T t) { return t.i; } class A { friend int ::f(A); int i; }; int main() { f(A()); // link error, trying to call non-template function=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 } I also notice that the bullet in question is gone in the C++23 draft, repla= ced by new wording in [dcl.meaning.general]: (2.2.1.3) =E2=80=94 each remaining function template is replaced with the specialization chosen by deduction from the friend declaration (13.10.3.7) = or discarded if deduction fails. So, it's not clear to me that this really counts as a regression.=