|
256 | 256 | \end{codeblock}
|
257 | 257 | \end{example}
|
258 | 258 |
|
| 259 | +\pnum |
| 260 | +\indextext{initialization!definition and}% |
| 261 | +An object definition causes |
| 262 | +storage of appropriate size and alignment to be reserved and |
| 263 | +any appropriate initialization\iref{dcl.init} to be done. |
| 264 | + |
259 | 265 | \pnum
|
260 | 266 | \indextext{definition!declaration as}%
|
261 | 267 | Syntactic components beyond those found in the general form of
|
262 | 268 | \grammarterm{simple-declaration} are added to a function declaration to make a
|
263 |
| -\grammarterm{function-definition}. An object declaration, however, is also |
264 |
| -a definition unless it contains the \keyword{extern} specifier and has no |
265 |
| -initializer\iref{basic.def}. |
266 |
| -\indextext{initialization!definition and}% |
267 |
| -An object definition causes storage of appropriate size and alignment to be reserved and |
268 |
| -any appropriate initialization\iref{dcl.init} to be done. |
| 269 | +\grammarterm{function-definition}. |
| 270 | +A token sequence starting with \tcode{\{} or \tcode{=} |
| 271 | +is treated as a \grammarterm{function-body}\iref{dcl.fct.def.general} |
| 272 | +if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general} |
| 273 | +is a function type, and |
| 274 | +is otherwise |
| 275 | +treated as a \grammarterm{brace-or-equal-initializer}\iref{dcl.init.general}. |
| 276 | +\begin{note} |
| 277 | +If the declaration acquires a function type through template instantiation, |
| 278 | +the program is ill-formed; see \ref{temp.spec.general}. |
| 279 | +The function type of a function definition |
| 280 | +cannot be specified with a \grammarterm{typedef-name}\iref{dcl.fct}. |
| 281 | +\end{note} |
269 | 282 |
|
270 | 283 | \pnum
|
271 | 284 | A \grammarterm{nodeclspec-function-declaration} shall declare a
|
|
0 commit comments