http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56971
Bug #: 56971 Summary: GCC claims a friend function to be overloaded, but it isn't Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: henn...@still-hidden.de template <typename T> class rp { }; template <template <typename> class P> struct b { template <class, template <typename> class FriendP> friend void f(b<FriendP> from); }; template <class, template <typename> class P> void f(b<P> from) { } int main() { b<rp> v; f<int>(v); return 0; } ----- > gcc map.cpp main.cpp: In function 'int main()': main.cpp:17:13: error: call of overloaded 'f(b<rp>&)' is ambiguous f<int>(v); ^ main.cpp:17:13: note: candidates are: main.cpp:12:6: note: void f(b<P>) [with <template-parameter-1-1> = int; P = rp] void f(b<P> from) { ^ main.cpp:8:17: note: void f(b<FriendP>) [with <template-parameter-2-1> = int; FriendP = rp; P = rp] friend void f(b<FriendP> from); ^ ----- I can't see an overload here.