Skip to content

Commit dda3279

Browse files
sdkrystianzygoloid
authored andcommitted
[dcl.init] Remove redundant specification of when value-initialization occurs
1 parent 98a10e2 commit dda3279

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

source/declarations.tex

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4320,31 +4320,6 @@
43204320
In some cases, additional initialization is done later.
43214321
\end{note}
43224322

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-
43484323
\pnum
43494324
If no initializer is specified for an object, the object is default-initialized.
43504325

@@ -4425,6 +4400,25 @@
44254400
\tcode{wchar_t},
44264401
and the initializer is a \grammarterm{string-literal}, see~\ref{dcl.init.string}.
44274402
\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+
44284422
\item
44294423
Otherwise, if the destination type is an array,
44304424
the object is initialized as follows.

0 commit comments

Comments
 (0)