// Build don't link: template struct S { template friend X f(X, Y, Z); }; template class S; template char f(char, long, short); template char* f(char*, long*, short*); template X f(X x, Y, Z) { return x; }