|
120 | 120 | \end{example}
|
121 | 121 |
|
122 | 122 | \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. |
| 123 | +If a \grammarterm{declarator-id} is a name, the |
| 124 | +\grammarterm{init-declarator} and (hence) the declaration introduce that name. |
| 125 | +\begin{note} |
| 126 | +Otherwise, the \grammarterm{declarator-id} is |
| 127 | +a \grammarterm{qualified-id} or |
| 128 | +names a destructor or |
| 129 | +its \grammarterm{unqualified-id} is a \grammarterm{template-id} and |
| 130 | +no name is introduced. |
| 131 | +\end{note} |
| 132 | +The \grammarterm{defining-type-specifier}{s}\iref{dcl.type} in |
| 133 | +the \grammarterm{decl-specifier-seq} and |
| 134 | +the recursive \grammarterm{declarator} structure |
| 135 | +describe a type\iref{dcl.meaning}, |
| 136 | +which is then associated with the \grammarterm{declarator-id}. |
135 | 137 |
|
136 | 138 | \pnum
|
137 | 139 | \indextext{identifier}%
|
|
157 | 159 | \end{codeblock}
|
158 | 160 | \end{example}
|
159 | 161 |
|
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 |
| - |
183 | 162 | \pnum
|
184 | 163 | A \grammarterm{simple-declaration} with an \grammarterm{identifier-list} is called
|
185 | 164 | a \defn{structured binding declaration}\iref{dcl.struct.bind}.
|
|
196 | 175 | where the
|
197 | 176 | \grammarterm{assignment-expression} is of array or non-union class type.
|
198 | 177 |
|
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 |
| - |
215 | 178 | \pnum
|
216 | 179 | If the \grammarterm{decl-specifier-seq} contains the \tcode{typedef}
|
217 | 180 | specifier, the declaration is called a \defnx{typedef declaration}{declaration!typedef}
|
|
231 | 194 | \pnum
|
232 | 195 | \indextext{definition!declaration as}%
|
233 | 196 | Syntactic components beyond those found in the general form of
|
234 |
| -declaration are added to a function declaration to make a |
| 197 | +\grammarterm{simple-declaration} are added to a function declaration to make a |
235 | 198 | \grammarterm{function-definition}. An object declaration, however, is also
|
236 | 199 | a definition unless it contains the \tcode{extern} specifier and has no
|
237 | 200 | initializer\iref{basic.def}.
|
238 | 201 | \indextext{initialization!definition and}%
|
239 | 202 | An object definition causes storage of appropriate size and alignment to be reserved and
|
240 | 203 | any appropriate initialization\iref{dcl.init} to be done.
|
241 | 204 |
|
| 205 | +\pnum |
| 206 | +\indextext{declaration}% |
| 207 | +\indextext{scope}% |
| 208 | +Certain declarations contain one or more scopes\iref{basic.scope.scope}. |
| 209 | +Unless otherwise stated, utterances in |
| 210 | +\ref{dcl.dcl} about components in, of, or contained by a |
| 211 | +declaration or subcomponent thereof refer only to those components of |
| 212 | +the declaration that are \emph{not} nested within scopes nested within |
| 213 | +the declaration. |
| 214 | + |
242 | 215 | \pnum
|
243 | 216 | A \grammarterm{nodeclspec-function-declaration} shall declare a
|
244 | 217 | constructor, destructor, or conversion function.
|
|
249 | 222 | \grammarterm{explicit-specialization}\iref{temp.expl.spec}.
|
250 | 223 | \end{note}
|
251 | 224 |
|
| 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 | + |
252 | 252 | \rSec1[dcl.spec]{Specifiers}%
|
253 | 253 |
|
254 | 254 | \rSec2[dcl.spec.general]{General}%
|
|
0 commit comments