The following code generates two different, ambiguous declarations of foo. I guess this is regression, as other compilers accept the code. I am using gcc 4-3-3
template<class A,template<class>class B> void foo(B<A>) { } template<class> class bar { template<class A,template<class>class B> friend void foo(B<A>); }; int main(int num_arguments, char* arguments[]) { foo(bar<int>()); /*error: call of overloaded 'foo(bar<int>)' is ambiguous n:298: note: candidates are: void foo(B<A>) [with A = int, B = bar] n:303: note: void foo(B<A>) [with A = int, B = bar, <template-parameter-1-1> = int]*/ } -- Summary: ambiguous implicit declaration of template friend function Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mrhelt at yahoo dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39328