// { dg-do compile } // Copyright (C) 2003 Free Software Foundation // Contributed by Kriang Lerdsuwanakij // Member function of class template as friend template struct A { void f(T); }; class C { int i; template friend void A::f(T); }; template struct A { void f(T*); }; template<> struct A { void f(char); }; template void A::f(T) { C c; c.i = 0; } template void A::f(T*) { C c; c.i = 0; } void A::f(char) { C c; c.i = 0; } int main() { A a1; a1.f(0); A a2; int *p = 0; a2.f(p); A a3; a3.f('a'); }