I believe gcc is in error for calling the int* overload in the program below. Sorry if this is a duplicate -- I went through the many lookup bugs in Bugzilla but none of them looked quite like this one. $ cat t.cpp && g++ -pedantic -W t.cpp && ./a.out #include <assert.h> int foo (void*) { return 0; } template <class T> int bar (T *p) { return foo (p); } int foo (int*) { return 1; } int main () { assert (0 == bar ((int*)0)); } Assertion failed: 0 == bar ((int*)0), file t.cpp, line 9 Abort (core dumped)
This was fixed by the same patch which fixed PR 2922. The issue was that GCC was not keeping track of the overloaded set.