// PR c++/56642 template struct A; template A f(T*) { return A(); } template struct A { friend A f(T*); }; int main() { int *p = 0; f(p); }