// { dg-do compile { target c++20 } } template concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" } struct Nt { template friend void f(T) { } } nt; template struct S; template void proc(S*); template struct S { friend bool operator==(S, S) requires Eq { return true; } friend void proc<>(S*); // { dg-error "does not match any template declaration" } }; struct X { } x; int main() { // f(0); // OK f(nt); // { dg-error "" } f(x); // { dg-error "3:'f' was not declared" } S si; si == si; // OK S sx; sx == sx; // { dg-error "no match" } }