------- Comment #2 from pi3orama at gmail dot com 2009-11-13 10:10 ------- This is an example in C++ language standard. The version is N2960. It said (at page 47, [basic.lookup.argdep]/3):
Let X be the lookup set produced by unqualified lookup (3.4.1) and let Y be the lookup set produced by argument dependent lookup (defined as follows). If X contains ¡ª a declaration of a class member, or ¡ª a block-scope function declaration that is not a using-declaration, or ¡ª a declaration that is neither a function or a function template then Y is empty. Otherwise Y is the set of declarations found in the namespaces associated with the argument types as described below. The set of declarations found by the lookup of the name is the union of X and Y. [ Note: the namespaces and classes associated with the argument types can include namespaces and classes already considered by the ordinary unqualified lookup. ¡ªend note ] and following is example: namespace NS { class T { }; void f(T); void g(T, int); } NS::T parm; void g(NS::T, float); int main() { f(parm); // OK: calls NS::f extern void g(NS::T, float); g(parm, 1); // OK: calls g(NS::T, float) } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42026