------- Comment #6 from yao_yin at 163 dot com 2010-03-25 02:11 ------- (In reply to comment #5) > Close as a dup of bug 29131. > Comment #3 is valid as the associated namespace for X is the global > namespace. > But with fundamental types there is currently no associated namespace so the > functions are not found. Now there is a defect report against the C++ > standard > which asks if this was done that way; that is what PR 29131 references and is > suspended until the C++ standards committee decides what should happen. > *** This bug has been marked as a duplicate of 29131 ***
Sorry, I gave a wrong example.. In fact, the code in PR 29131: template<class T> int t(T i) { return f (i); // OK, with g++ 4.4.3 } int f (int i) { return i; } int main() { return t(1); } can be compiled with g++ 4.4.3 but the following code cannot: template<class T> int f(int k, T i) { return f(i); // error: f not visible here } int f (int i) // overload { return i; } int main() { return f(1, 2); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43506