// { dg-do compile } // Copyright (C) 2003 Free Software Foundation // Contributed by Kriang Lerdsuwanakij // Member function of class template as friend // Erroneous case: mismatch during declaration template struct A { template void f(U); // { dg-error "candidate" } void g(); // { dg-error "candidate|with" } void h(); // { dg-error "candidate|with" } void i(int); // { dg-error "candidate" } }; class C { int ii; template friend void A::f(U); // { dg-error "not match" } template template friend void A::g(); // { dg-error "not match|cannot be overloaded" } template friend int A::h(); // { dg-error "not match|cannot be overloaded" } template friend void A::i(char); // { dg-error "not match" } };