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

2024-03-20


171. Global namespace scope

Section: 9.8  [basic.namespace]     Status: TC1     Submitter: Greg Lutz     Date: 19 Sep 1999

9.8 [basic.namespace] paragraph 2 says:

A name declared outside all named namespaces, blocks (8.4 [stmt.block] ) and classes (Clause 11 [class] ) has global namespace scope (6.4.6 [basic.scope.namespace] ).
But 6.4.6 [basic.scope.namespace] paragraph 3 says:
A name declared outside all named or unnamed namespaces (9.8 [basic.namespace] ), blocks (8.4 [stmt.block] ), function declarations (9.3.4.6 [dcl.fct] ), function definitions (9.5 [dcl.fct.def] ) and classes (Clause 11 [class] ) has global namespace scope (also called global scope).
9.8 [basic.namespace] should evidently be changed to match the wording in 6.4.6 [basic.scope.namespace] — the unnamed namespace is not global scope.

Proposed resolution (10/00):

  1. Replace the first sentence of 6.4.6 [basic.scope.namespace] paragraph 3 with

    The outermost declarative region of a translation unit is also a namespace, called the global namespace. A name declared in the global namespace has global namespace scope (also called global scope).
  2. In the last sentence of the same paragraph, change "Names declared in the global namespace scope" to "Names with global namespace scope."

  3. Replace 9.8 [basic.namespace] paragraph 2 with

    The outermost declarative region of a translation unit is a namespace; see 6.4.6 [basic.scope.namespace].