template <typename T> struct A { template <typename U> friend void foo(A<U>) {} }; int main() { A<char> a1; A<double> a2; }
Standard input is empty
prog.cpp: In instantiation of ‘A<double>’: prog.cpp:11: instantiated from here prog.cpp:5: error: redefinition of ‘template<class U> void foo(A<U>)’ prog.cpp:5: error: ‘template<class U> void foo(A<U>)’ previously defined here prog.cpp: In function ‘int main()’: prog.cpp:10: warning: unused variable ‘a1’ prog.cpp:11: warning: unused variable ‘a2’
Standard output is empty