https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91618

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Interesting, seems that G++ never implemented that bullet.  Even though we
allowed the friend declaration, it didn't match the template:

template <class T> 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                   
}

I also notice that the bullet in question is gone in the C++23 draft, replaced
by new wording in [dcl.meaning.general]:

(2.2.1.3) — 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.

Reply via email to