------- Comment #3 from hbgku6602 at sneakemail dot com 2006-07-24 15:30 ------- (In reply to comment #1) > All gcc versions I have take the template in namespace odd, and so does > icc in strict mode. I see nothing in 3.4.2 that should prevent this > from happening. What is relevant here is that the using declaration inside > the function introduces a name into the innermost namespace, thus preventing > name lookup from even looking outside the function.
It would have been so say in case of int. But since A is a class-type, it has associated namespace odd, and according to 3.4.2/2a odd::f will be included in the set of declarations regardless of visibility of odd::f by ordinary rules. 3.4.2/1 "When an unqualified name is used as the postfix-expression in a function call (5.2.2), other namespaces not considered during the usual unqualified lookup (3.4.1) may be searched, and namespace-scope friend function declarations (11.4) not otherwise visible may be found." 3.4.2/2a "If the ordinary unqualified lookup of the name finds the declaration of a class member function, the associated namespaces and classes are not considered. Otherwise the set of declarations found by the lookup of the function name is the union of the set of declarations found using ordinary unqualified lookup and the set of declarations found in the namespaces and classes associated with the argument types." -- hbgku6602 at sneakemail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hbgku6602 at sneakemail dot | |com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21615