Community
Participate
Working Groups
template <typename A, typename B> void foo(A* a, B b) { } template <typename A, typename B> void foo(A a, B* b) { } int main() { int *i, *j; foo(j, i); return 0; } The error displayed is : 'foo' is ambiguous ' Candidates are: void foo(int *, int *) ' Perhaps instead it should display: void foo(int *, int) void foo(int, int*)
(In reply to Marc-André Laperle from comment #0) > Perhaps instead it should display: > void foo(int *, int) > void foo(int, int*) It should not display that. The instantiated signatures are both 'foo(int*, int*)' (the first arising from instantiating the first template with A=int and B=int*, and the second arising from instantiating the second template with A=int* and B=int). Here's what gcc displays: void foo(A*, B) [with A = int; B = int*] void foo(A, B*) [with A = int*; B = int] That would be a better thing for us to display too.