------- Comment #3 from rvovsd at mail dot ru 2008-01-21 14:43 ------- This case is similar to the bug 31047 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31047).
There Andrew Pinski wrote (comment 4): >14.6.4.2/1 says this is invalid code. >For a function call that depends on a template parameter, if the function is an >unqualified-id but not a template-id, the candiate functions are found using >the usual lookup rules (3.4.1, 3.4.2) except that: >.... > >Paraphasing since I don't want to type it all in >* non argument dependent lookup (3.4.1: template definition context >* argument dependent lookup (3.4.2): template definition context and template >instation context This case is argument dependent lookup, therefore should used both contexts - definition and instantiation. Point of instantiation "sel(T* a) with T = void" - after "void f(void*)" and before "int main()". Thus should be visible both f(void*) and f(Y*), whether not so? Why gcc does not see "void f (void *)"? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34886