Skip to content

Commit d693d46

Browse files
Dawn Perchikzygoloid
authored andcommitted
CWG1795 Disambiguating original-namespace-definition and extension-namespace-definition
At use of "extended" in change to namespace.udir, added reference to section namespace.def (which contains the definition for "extends").
1 parent c11a26a commit d693d46

2 files changed

Lines changed: 23 additions & 51 deletions

File tree

‎source/basic.tex‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,7 @@
776776
\pnum
777777
\indextext{scope!namespace}%
778778
The declarative region of a \grammarterm{namespace-definition} is its
779-
\grammarterm{namespace-body}. The potential scope denoted by an
780-
\grammarterm{original-namespace-name} is the concatenation of the
781-
declarative regions established by each of the
782-
\grammarterm{namespace-definition}{s} in the same declarative region with
783-
that \grammarterm{original-namespace-name}. Entities declared in a
779+
\grammarterm{namespace-body}. Entities declared in a
784780
\grammarterm{namespace-body} are said to be \defn{members} of the
785781
namespace, and names introduced by these declarations into the
786782
declarative region of the namespace are said to be \defn{member

‎source/declarations.tex‎

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,15 +2092,10 @@
20922092

20932093
\begin{bnf}
20942094
\nontermdef{namespace-name}\br
2095-
original-namespace-name\br
2095+
identifier\br
20962096
namespace-alias
20972097
\end{bnf}
20982098

2099-
\begin{bnf}
2100-
\nontermdef{original-namespace-name}\br
2101-
identifier
2102-
\end{bnf}
2103-
21042099
\begin{bnf}
21052100
\nontermdef{namespace-definition}\br
21062101
named-namespace-definition\br
@@ -2109,20 +2104,9 @@
21092104

21102105
\begin{bnf}
21112106
\nontermdef{named-namespace-definition}\br
2112-
original-namespace-definition\br
2113-
extension-namespace-definition
2114-
\end{bnf}
2115-
2116-
\begin{bnf}
2117-
\nontermdef{original-namespace-definition}\br
21182107
\terminal{inline\opt} \terminal{namespace} identifier \terminal{\{} namespace-body \terminal{\}}
21192108
\end{bnf}
21202109

2121-
\begin{bnf}
2122-
\nontermdef{extension-namespace-definition}\br
2123-
\terminal{inline\opt} \terminal{namespace} original-namespace-name \terminal{\{} namespace-body \terminal{\}}
2124-
\end{bnf}
2125-
21262110
\begin{bnf}
21272111
\nontermdef{unnamed-namespace-definition}\br
21282112
\terminal{inline\opt} \terminal{namespace \{} namespace-body \terminal{\}}
@@ -2133,24 +2117,24 @@
21332117
declaration-seq\opt
21342118
\end{bnf}
21352119

2136-
\pnum
2137-
The \grammarterm{identifier} in an \grammarterm{original-namespace-definition}
2138-
shall not have been previously defined in the declarative region in
2139-
which the \grammarterm{original-namespace-definition} appears. The
2140-
\grammarterm{identifier} in an \grammarterm{original-namespace-definition} is
2141-
the name of the namespace. Subsequently in that declarative region, it
2142-
is treated as an \grammarterm{original-namespace-name}.
2143-
2144-
\pnum
2145-
The \grammarterm{original-namespace-name} in an
2146-
\grammarterm{extension-namespace-definition} shall have previously been
2147-
defined in an \grammarterm{original-namespace-definition} in the same
2148-
declarative region.
2149-
21502120
\pnum
21512121
Every \grammarterm{namespace-definition} shall appear in the global scope
21522122
or in a namespace scope~(\ref{basic.scope.namespace}).
21532123

2124+
\pnum
2125+
In a \grammarterm{named-namespace-definition},
2126+
the \grammarterm{identifier} is the name of the namespace.
2127+
If the \grammarterm{identifier}, when looked up~(\ref{basic.lookup.unqual}),
2128+
refers to a \grammarterm{namespace-name} (but not a \grammarterm{namespace-alias})
2129+
introduced in the declarative region
2130+
in which the \grammarterm{named-namespace-definition} appears,
2131+
the \grammarterm{namespace-definition}
2132+
\indextext{extend|see{namespace, extend}}
2133+
\defnx{extends}{namespace!extend} the previously-declared namespace.
2134+
Otherwise, the \grammarterm{identifier} is introduced
2135+
as a \grammarterm{namespace-name} into the declarative region
2136+
in which the \grammarterm{named-namespace-definition} appears.
2137+
21542138
\pnum
21552139
Because a \grammarterm{namespace-definition} contains
21562140
\grammarterm{declaration}{s} in its \grammarterm{namespace-body} and a
@@ -2197,9 +2181,9 @@
21972181
If the optional initial \tcode{inline} keyword appears in a
21982182
\grammarterm{namespace-definition} for a particular namespace, that namespace is
21992183
declared to be an \term{inline namespace}. The \tcode{inline} keyword may be
2200-
used on an \grammarterm{extension-namespace-definition} only if it was
2201-
previously used on the \grammarterm{original-namespace-definition} for that
2202-
namespace.
2184+
used on a \grammarterm{namespace-definition} that extends a namespace
2185+
only if it was previously used on the \grammarterm{namespace-definition}
2186+
that initially declared the \grammarterm{namespace-name} for that namespace.
22032187

22042188
\pnum
22052189
Members of an inline namespace can be used in most respects as though they were members
@@ -2424,14 +2408,6 @@
24242408
\end{codeblock}
24252409
\exitexample
24262410

2427-
\pnum
2428-
A \grammarterm{namespace-name} or \grammarterm{namespace-alias} shall not be
2429-
declared as the name of any other entity in the same declarative region.
2430-
A \grammarterm{namespace-name} defined at global scope shall not be
2431-
declared as the name of any other entity in any global scope of the
2432-
program. No diagnostic is required for a violation of this rule by
2433-
declarations in different translation units.
2434-
24352411
\rSec2[namespace.udecl]{The \tcode{using} declaration}%
24362412
\indextext{using-declaration|(}
24372413

@@ -2976,14 +2952,14 @@
29762952
\end{codeblock}
29772953
\exitexample
29782954

2955+
29792956
\pnum
2980-
If a namespace is extended by an
2981-
\grammarterm{extension-namespace-definition} after a
2957+
If a namespace is extended~(\ref{namespace.def}) after a
29822958
\grammarterm{using-directive} for that namespace is given, the additional
29832959
members of the extended namespace and the members of namespaces
29842960
nominated by \grammarterm{using-directive}{s} in the
2985-
\grammarterm{extension-namespace-definition} can be used after the
2986-
\grammarterm{extension-namespace-definition}.
2961+
extending \grammarterm{namespace-definition} can be used after the
2962+
extending \grammarterm{namespace-definition}.
29872963

29882964
\pnum
29892965
If name lookup finds a declaration for a name in two different

0 commit comments

Comments
 (0)