// PR c++/59366 // { dg-do compile } template void f(T); struct S { template friend void f(T) {} template friend void g(T) {} template friend void h(T) {} }; template void h(T); int main () { f(1); g(1); // { dg-error "3:'g' was not declared in this scope" } g(S()); h(1); }