| |
| Bugzilla Link | 38883 |
| Resolution | FIXED |
| Resolved on | May 10, 2019 10:44 |
| Version | 8.0 |
| OS | All |
| CC | @DougGregor |
Extended Description
Clang rejects this valid code with an access violation error:
struct A { template static int g0(T x) { return x.n; } };
template class B { friend int A::g0<>(B); int n; };
int k = A().g0(B());
The problem is that in the instantiation B, the friend declaration points nowhere (and does not identify the A::g0<B> specialization that it should). Despite the friend declaration not being matched to any function, no diagnostic is issued, and the result is the friend declaration is silently ignored.