Skip to content

Commit 793eb7b

Browse files
authored
[dcl.pre] Reorder paragraphs (#4462)
Group discussion of simple-declaration and move other kinds of declarations to the end.
1 parent fab6f7f commit 793eb7b

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

source/declarations.tex

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@
9191
\grammarterm{using-directive}{s} are described in~\ref{namespace.udir}.
9292
\end{note}
9393

94+
\pnum
95+
\indextext{declaration}%
96+
\indextext{scope}%
97+
Certain declarations contain one or more scopes\iref{basic.scope.scope}.
98+
Unless otherwise stated, utterances in
99+
\ref{dcl.dcl} about components in, of, or contained by a
100+
declaration or subcomponent thereof refer only to those components of
101+
the declaration that are \emph{not} nested within scopes nested within
102+
the declaration.
103+
94104
\pnum
95105
A
96106
\grammarterm{simple-declaration} or
@@ -120,18 +130,20 @@
120130
\end{example}
121131

122132
\pnum
123-
Except where otherwise specified, the meaning of an \grammarterm{attribute-declaration}
124-
is \impldef{meaning of attribute declaration}.
125-
126-
\pnum
127-
\indextext{declaration}%
128-
\indextext{scope}%
129-
Certain declarations contain one or more scopes\iref{basic.scope.scope}.
130-
Unless otherwise stated, utterances in
131-
\ref{dcl.dcl} about components in, of, or contained by a
132-
declaration or subcomponent thereof refer only to those components of
133-
the declaration that are \emph{not} nested within scopes nested within
134-
the declaration.
133+
If a \grammarterm{declarator-id} is a name, the
134+
\grammarterm{init-declarator} and (hence) the declaration introduce that name.
135+
\begin{note}
136+
Otherwise, the \grammarterm{declarator-id} is
137+
a \grammarterm{qualified-id} or
138+
names a destructor or
139+
its \grammarterm{unqualified-id} is a \grammarterm{template-id} and
140+
no name is introduced.
141+
\end{note}
142+
The \grammarterm{defining-type-specifier}{s}\iref{dcl.type} in
143+
the \grammarterm{decl-specifier-seq} and
144+
the recursive \grammarterm{declarator} structure
145+
describe a type\iref{dcl.meaning},
146+
which is then associated with the \grammarterm{declarator-id}.
135147

136148
\pnum
137149
\indextext{identifier}%
@@ -157,29 +169,6 @@
157169
\end{codeblock}
158170
\end{example}
159171

160-
\pnum
161-
\indextext{\idxgram{static_assert}}%
162-
In a \grammarterm{static_assert-declaration}, the
163-
\grammarterm{constant-expression} shall be
164-
a contextually converted constant expression
165-
of type \tcode{bool}\iref{expr.const}.
166-
If the value of the expression when
167-
so converted is \tcode{true}, the declaration has no
168-
effect. Otherwise, the program is ill-formed, and the resulting
169-
diagnostic message\iref{intro.compliance} shall include the text of
170-
the \grammarterm{string-literal}, if one is supplied,
171-
except that characters not in the basic
172-
source character set\iref{lex.charset} are not required to appear in
173-
the diagnostic message.
174-
\begin{example}
175-
\begin{codeblock}
176-
static_assert(sizeof(int) == sizeof(void*), "wrong pointer size");
177-
\end{codeblock}
178-
\end{example}
179-
180-
\pnum
181-
An \grammarterm{empty-declaration} has no effect.
182-
183172
\pnum
184173
A \grammarterm{simple-declaration} with an \grammarterm{identifier-list} is called
185174
a \defn{structured binding declaration}\iref{dcl.struct.bind}.
@@ -196,22 +185,6 @@
196185
where the
197186
\grammarterm{assignment-expression} is of array or non-union class type.
198187

199-
\pnum
200-
If a \grammarterm{declarator-id} is a name, the
201-
\grammarterm{init-declarator} and (hence) the declaration introduce that name.
202-
\begin{note}
203-
Otherwise, the \grammarterm{declarator-id} is
204-
a \grammarterm{qualified-id} or
205-
names a destructor or
206-
its \grammarterm{unqualified-id} is a \grammarterm{template-id} and
207-
no name is introduced.
208-
\end{note}
209-
The \grammarterm{defining-type-specifier}{s}\iref{dcl.type} in
210-
the \grammarterm{decl-specifier-seq} and
211-
the recursive \grammarterm{declarator} structure
212-
describe a type\iref{dcl.meaning},
213-
which is then associated with the \grammarterm{declarator-id}.
214-
215188
\pnum
216189
If the \grammarterm{decl-specifier-seq} contains the \tcode{typedef}
217190
specifier, the declaration is called a \defnx{typedef declaration}{declaration!typedef}
@@ -231,7 +204,7 @@
231204
\pnum
232205
\indextext{definition!declaration as}%
233206
Syntactic components beyond those found in the general form of
234-
declaration are added to a function declaration to make a
207+
\grammarterm{simple-declaration} are added to a function declaration to make a
235208
\grammarterm{function-definition}. An object declaration, however, is also
236209
a definition unless it contains the \tcode{extern} specifier and has no
237210
initializer\iref{basic.def}.
@@ -249,6 +222,33 @@
249222
\grammarterm{explicit-specialization}\iref{temp.expl.spec}.
250223
\end{note}
251224

225+
\pnum
226+
\indextext{\idxgram{static_assert}}%
227+
In a \grammarterm{static_assert-declaration}, the
228+
\grammarterm{constant-expression} shall be
229+
a contextually converted constant expression
230+
of type \tcode{bool}\iref{expr.const}.
231+
If the value of the expression when
232+
so converted is \tcode{true}, the declaration has no
233+
effect. Otherwise, the program is ill-formed, and the resulting
234+
diagnostic message\iref{intro.compliance} shall include the text of
235+
the \grammarterm{string-literal}, if one is supplied,
236+
except that characters not in the basic
237+
source character set\iref{lex.charset} are not required to appear in
238+
the diagnostic message.
239+
\begin{example}
240+
\begin{codeblock}
241+
static_assert(sizeof(int) == sizeof(void*), "wrong pointer size");
242+
\end{codeblock}
243+
\end{example}
244+
245+
\pnum
246+
An \grammarterm{empty-declaration} has no effect.
247+
248+
\pnum
249+
Except where otherwise specified, the meaning of an \grammarterm{attribute-declaration}
250+
is \impldef{meaning of attribute declaration}.
251+
252252
\rSec1[dcl.spec]{Specifiers}%
253253

254254
\rSec2[dcl.spec.general]{General}%

0 commit comments

Comments
 (0)