Title
Contradictions regarding inline namespaces
Status
cd2
Section
9.8.2 [namespace.def]
Submitter
Michael Wong

Created on 2009-06-19.00:00:00 last changed 178 months ago

Messages

Date: 2010-03-15.00:00:00

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

Date: 2009-11-15.00:00:00

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

      nested-name-specifier unqualified-id

    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.)

Date: 2020-12-15.00:00:00

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
    nested-name-specifier unqualified-id
the unqualified-id shall name a member of the namespace designated by the nested-name-specifier.
History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2692
2010-03-29 00:00:00adminsetstatus: tentatively ready -> cd2
2010-02-16 00:00:00adminsetstatus: drafting -> tentatively ready
2009-11-08 00:00:00adminsetstatus: ready -> drafting
2009-08-03 00:00:00adminsetmessages: + msg2158
2009-08-03 00:00:00adminsetstatus: open -> ready
2009-06-19 00:00:00admincreate