C++ Logo

std-discussion

Advanced search

Unqualified name lookup

From: Russell Shaw <rjshaw_at_[hidden]>
Date: Sun, 30 Nov 2025 01:04:34 +1100
Hi,

In [basic.lookup.unqual]:

**********************************************

An unqualified search in a scope S from a program point P includes the results
of searches from P in
— S, and
— for any scope U that contains P and is or is contained by S, each namespace
contained by S that is nominated by a using-directive that is active in U at P.

**********************************************

namespace A {
     int a;
}

namespace S {
     namespace T {
      namespace U {
          using namespace A;
     int p = a;
 }
     }
}

int main()
{
}

**********************************************

"namespace A" is not contained in "namespace S". So what does the second
statement mean ?

Received on 2025-11-29 14:04:42