Title
Namespaces, declarative regions, and translation units
Status
cd6
Section
_N4868_.6.4.1 [basic.scope.declarative]
Submitter
Richard Smith

Created on 2015-07-30.00:00:00 last changed 20 months ago

Messages

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]

The definition of “declarative region” given in _N4868_.6.4.1 [basic.scope.declarative] paragraph 1 is,

Every name is introduced in some portion of program text called a declarative region, which is the largest part of the program in which that name is valid, that is, in which that name may be used as an unqualified name to refer to the same entity.

According to 9.8 [basic.namespace] paragraph 1,

Unlike other declarative regions, the definition of a namespace can be split over several parts of one or more translation units.

This seems like a misuse of the term “declarative region”; in particular, a name x declared in namespace N in translation unit A cannot be used as an unqualified name in the part of namespace N in translation unit B unless it is also declared in B. See also issue 1884.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: accepted -> drwp
2020-12-15 00:00:00adminsetstatus: drafting -> accepted
2015-07-30 00:00:00admincreate