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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC accept the original testcase now in C++20 mode since GCC 9+ and reject it
in C++98, C++11, C++14, and C++17 modes.
Clang also rejects it in < C++20 but with a decent error message:
<source>:2:14: error: use of function template name with no prior declaration
in function call with explicit template arguments is a C++20 extension
[-Werror,-Wc++20-extensions]


The following testcase:
template <class T> void f(T, T);
namespace P {
struct A { template<int N> friend void f(A) { } }; 
}
int main() { f<1>(P::A()); }

Has been accepted since at least GCC 4.4.7.

So is this bug fixed?

Reply via email to