// Build don't link: template void foo(); template class bar { public: int i; template friend void foo(); // ERROR - template-id }; template void foo() { bar baz; baz.i = 1; bar buz; buz.i = 1; } int main() { foo(); foo(); }