|
4320 | 4320 | In some cases, additional initialization is done later. |
4321 | 4321 | \end{note} |
4322 | 4322 |
|
4323 | | -\pnum |
4324 | | -An object whose initializer is an empty set of parentheses, i.e., |
4325 | | -\tcode{()}, |
4326 | | -shall be |
4327 | | -value-initialized. |
4328 | | - |
4329 | | -\indextext{ambiguity!function declaration}% |
4330 | | -\begin{note} |
4331 | | -Since |
4332 | | -\tcode{()} |
4333 | | -is not permitted by the syntax for |
4334 | | -\grammarterm{initializer}, |
4335 | | -\begin{codeblock} |
4336 | | -X a(); |
4337 | | -\end{codeblock} |
4338 | | -is not the declaration of an object of class |
4339 | | -\tcode{X}, |
4340 | | -but the declaration of a function taking no argument and returning an |
4341 | | -\tcode{X}. |
4342 | | -The form |
4343 | | -\tcode{()} |
4344 | | -is permitted in certain other initialization contexts~(\ref{expr.new}, |
4345 | | -\ref{expr.type.conv}, \ref{class.base.init}). |
4346 | | -\end{note} |
4347 | | - |
4348 | 4323 | \pnum |
4349 | 4324 | If no initializer is specified for an object, the object is default-initialized. |
4350 | 4325 |
|
|
4425 | 4400 | \tcode{wchar_t}, |
4426 | 4401 | and the initializer is a \grammarterm{string-literal}, see~\ref{dcl.init.string}. |
4427 | 4402 | \item If the initializer is \tcode{()}, the object is value-initialized. |
| 4403 | +\indextext{ambiguity!function declaration}% |
| 4404 | +\begin{note} |
| 4405 | +Since |
| 4406 | +\tcode{()} |
| 4407 | +is not permitted by the syntax for |
| 4408 | +\grammarterm{initializer}, |
| 4409 | +\begin{codeblock} |
| 4410 | +X a(); |
| 4411 | +\end{codeblock} |
| 4412 | +is not the declaration of an object of class |
| 4413 | +\tcode{X}, |
| 4414 | +but the declaration of a function taking no argument and returning an |
| 4415 | +\tcode{X}. |
| 4416 | +The form |
| 4417 | +\tcode{()} |
| 4418 | +is permitted in certain other initialization contexts~(\ref{expr.new}, |
| 4419 | +\ref{expr.type.conv}, \ref{class.base.init}). |
| 4420 | +\end{note} |
| 4421 | + |
4428 | 4422 | \item |
4429 | 4423 | Otherwise, if the destination type is an array, |
4430 | 4424 | the object is initialized as follows. |
|
0 commit comments