Unqualified name lookup

For an unqualified name, that is a name that does not appear to the right of a scope resolution operator ::, name lookup examines the scopes as described below, until it finds at least one declaration of any kind, at which time the lookup stops and no further scopes are examined. (Note: lookup from some contexts skips some declarations, for example, lookup of the name used to the left of :: ignores function, variable, and enumerator declarations, lookup of a name used as a base class specifier ignores all non-type declarations).

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 490C++98any name in a template argument in a friendmember function declaration was not lookedup in the scope of the member function’s classonly excludes the namesin template arguments inthe declarator identifier
CWG 514C++98any unqualified name used in namespacescope was first looked up in that scopethe unqualified names used to define anamespace variable member outside thatnamespace are first looked up in that namespace

# See also