This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


986. Transitivity of using-directives versus qualified lookup

Section: 9.8.4  [namespace.udir]     Status: CD2     Submitter: Michael Wong     Date: 19 October, 2009

[Voted into WP at March, 2010 meeting.]

According to 9.8.4 [namespace.udir] paragraph 4,

The using-directive is transitive: if a scope contains a using-directive that nominates a second namespace that itself contains using-directives, the effect is as if the using-directives from the second namespace also appeared in the first.

This is true only for unqualified lookup; the algorithm in 6.5.5.3 [namespace.qual] paragraph 2 gives different results (the transitive closure terminates when a declaration of the name being looked up is found).

Proposed resolution (October, 2009):

Change 9.8.4 [namespace.udir] paragraph 4 as follows:

The For unqualified lookup (6.5.3 [basic.lookup.unqual]), the using-directive is transitive: if a scope contains a using-directive that nominates a second namespace that itself contains using-directives, the effect is as if the using-directives from the second namespace also appeared in the first. [Note: For qualified lookup, see 6.5.5.3 [namespace.qual]. —end note] [Example:...