Skip to content

Commit 005c5e4

Browse files
committed
CWG2859 Value-initialization with multiple default constructors
1 parent e26d116 commit 005c5e4

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

source/basic.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,9 +3473,10 @@
34733473
The \defn{lifetime} of an object or reference is a runtime property of the
34743474
object or reference.
34753475
A variable is said to have \defnadj{vacuous}{initialization}
3476-
if it is default-initialized and,
3476+
if it is default-initialized, no other initialization is performed, and,
34773477
if it is of class type or a (possibly multidimensional) array thereof,
3478-
that class type has a trivial default constructor.
3478+
a trivial constructor of that class type is selected for
3479+
the default-initialization.
34793480
The lifetime of an object of type \tcode{T} begins when:
34803481
\begin{itemize}
34813482
\item storage with the proper alignment and size

source/declarations.tex

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,15 +4629,10 @@
46294629
If
46304630
\tcode{T}
46314631
is a (possibly cv-qualified) class type\iref{class}, then
4632-
\begin{itemize}
4633-
\item
4634-
if \tcode{T} has
4635-
either no default constructor\iref{class.default.ctor} or a default
4636-
constructor that is user-provided or deleted, then the object is default-initialized;
4637-
\item
4638-
otherwise,
4639-
the object is zero-initialized and then default-initialized.
4640-
\end{itemize}
4632+
let \tcode{C} be the constructor selected to
4633+
default-initialize the object, if any.
4634+
If \tcode{C} is not user-provided, the object is first zero-initialized.
4635+
In all cases, the object is then default-initialized.
46414636

46424637
\item
46434638
If

0 commit comments

Comments
 (0)