Created on 2013-10-04.00:00:00 last changed 95 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed Resolution (July, 2014):
Change 6.4.6 [basic.scope.namespace] paragraph 1 as follows:
The declarative region of a namespace-definition is its namespace-body.The potential scope denoted by an original-namespace-name is the concatenation of the declarative regions established by each of the namespace-definitions in the same declarative region with that original-namespace-name.Entities declared in a namespace-body...
Change 9.8.2 [namespace.def] paragraphs 1-4 as follows:
The grammar for a namespace-definition is
namespace-name:
original-namespace-nameidentifier
namespace-alias
original-namespace-name:
identifiernamespace-definition:
named-namespace-definition
unnamed-namespace-definitionnamed-namespace-definition:
original-namespace-definition
extension-namespace-definition
original-namespace-definition:inlineopt namespace identifier { namespace-body }
extension-namespace-definition:
inlineopt namespace original-namespace-name { namespace-body }unnamed-namespace-definition:
inlineopt namespace { namespace-body }
namespace-body:
declaration-seqopt
The identifier in an original-namespace-definition shall not have been previously defined in the declarative region in which the original-namespace-definition appears. The identifier in an original-namespace-definition is the name of the namespace. Subsequently in that declarative region, it is treated as an original-namespace-name.
The original-namespace-name in an extension-namespace-definition shall have previously been defined in an original-namespace-definition in the same declarative region.Every namespace-definition shall appear in the global scope or in a namespace scope (6.4.6 [basic.scope.namespace]).
In a named-namespace-definition, the identifier is the name of the namespace. If the identifier, when looked up (6.5.3 [basic.lookup.unqual]), refers to a namespace-name (but not a namespace-alias) introduced in the declarative region in which the named-namespace-definition appears, the namespace-definition extends the previously-declared namespace. Otherwise, the identifier is introduced as a namespace-name into the declarative region in which the named-namespace-definition appears.
Change 9.8.2 [namespace.def] paragraph 7 as follows:
If the optional initial inline keyword appears in a namespace-definition for a particular namespace, that namespace is declared to be an inline namespace. The inline keyword may be used onan extension-namespace-definitiona namespace-definition that extends a namespace only if it was previously used on theoriginal-namespace-definitionnamespace-definition that initially declared the namespace-name for that namespace.
Delete 9.8.3 [namespace.alias] paragraph 4:
A namespace-name or namespace-alias shall not be declared as the name of any other entity in the same declarative region. A namespace-name defined at global scope shall not be declared as the name of any other entity in any global scope of the program. No diagnostic is required for a violation of this rule by declarations in different translation units.
Change 9.8.4 [namespace.udir] paragraph 5 as follows:
If a namespace is extendedby an extension-namespace-definitionafter a using-directive for that namespace is given, the additional members of the extended namespace and the members of namespaces nominated by using-directives in theextension-namespace-definitionextending namespace-definition can be used after theextension-namespace-definitionextending namespace-definition.
According to 9.8.2 [namespace.def] paragraph 2,
The identifier in an original-namespace-definition shall not have been previously defined in the declarative region in which the original-namespace-definition appears.
Apparently the intent of this requirement is to say that, given the declarations
namespace N { } namespace N { }
the second declaration is to be taken as an extension-namespace-definition and not an original-namespace-definition, since the general rules in _N4868_.6.4.1 [basic.scope.declarative] cover the case in which the identifier has been previously declared as something other than a namespace.
This use of “shall” for disambiguation is novel, however, and it would be better to replace it with a specific statement addressing disambiguation in paragraphs 2 and 3.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5368 |
2014-11-24 00:00:00 | admin | set | status: tentatively ready -> dr |
2014-10-13 00:00:00 | admin | set | messages: + msg5135 |
2014-10-13 00:00:00 | admin | set | status: drafting -> tentatively ready |
2014-03-03 00:00:00 | admin | set | status: open -> drafting |
2013-10-04 00:00:00 | admin | create |