Closed
Description
An explicit specialization declaration shall not be a friend declaration.
Clang compiles this code:
https://godbolt.org/z/eeah47bvb
template<int N>
consteval int foo();
template<int N>
struct Foo {
friend consteval
int foo<N>() {
return 1;
}
};
struct Bar {
friend consteval
int foo<1>() {
return 2;
}
};
int main() {
Foo<0> f;
return foo<0>() + foo<1>();
}