Open
Description
Consider the following example:
template <class T>
struct A
{
void f(T) {}
template <typename MUT> void f(MUT t){}
};
template<>
struct A<int>
{
void f(int) {}
template <typename MUT> void f(MUT t){}
};
template
void A<int>::f(int);
Here the template function template<typename MUT> void f(MUT t)
seems to be a feasible candidate for the explicit template function instantiation, but clang does not notice that:
<source>:16:14: error: explicit instantiation refers to member function 'A<int>::f' that is not an instantiation
16 | void A<int>::f(int);
| ^
<source>:11:10: note: explicit instantiation refers here
11 | void f(int) {}
| ^
1 error generated.
GCC, EDG, and MSVC accept that: https://godbolt.org/z/qs1Tcr5s6
Activity