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

2024-10-26


919. Contradictions regarding inline namespaces

Section: 9.8.2  [namespace.def]     Status: CD2     Submitter: Michael Wong     Date: 19 June, 2009

[Voted into WP at March, 2010 meeting as part of document N3079.]

According to 9.8.2 [namespace.def] paragraph 8,

Members of an inline namespace can be used in most respects as though they were members of the enclosing namespace... Furthermore, each member of the inline namespace can subsequently be explicitly instantiated (13.9.3 [temp.explicit]) or explicitly specialized (13.9.4 [temp.expl.spec]) as though it were a member of the enclosing namespace.

However, that assertion is contradicted for class template specializations by Clause 11 [class] paragraph 11:

If a class-head contains a nested-name-specifier, the class-specifier shall refer to a class that was previously declared directly in the class or namespace to which the nested-name-specifier refers...

It is also contradicted for function template specializations by 6.5.5.3 [namespace.qual] paragraph 6:

In a declaration for a namespace member in which the declarator-id is a qualified-id, given that the qualified-id for the namespace member has the form the unqualified-id shall name a member of the namespace designated by the nested-name-specifier.

Proposed resolution (November, 2009):

  1. Change Clause 11 [class] paragraph 11 as follows:

  2. If a class-head contains a nested-name-specifier, the class-specifier shall refer to a class that was previously declared directly in the class or namespace to which the nested-name-specifier refers, or in an element of the inline namespace set (9.8.2 [namespace.def]) of that namespace (i.e., neither not merely inherited nor or introduced by a using-declaration), and the class-specifier shall appear in a namespace enclosing the previous declaration.
  3. Change 6.5.5.3 [namespace.qual] paragraph 6 as follows:

  4. In a declaration for a namespace member in which the declarator-id is a qualified-id, given that the qualified-id for the namespace member has the form

    the unqualified-id shall name a member of the namespace designated by the nested-name-specifier, or of an element of the inline namespace (9.8.2 [namespace.def]) of that namespace. [Example:...

(Note: this resolution depends on the resolution for issue 861.)