Skip to content

Commit 2785faa

Browse files
burblebeetkoeppe
authored andcommitted
CWG2859 Value-initialization with multiple default constructors
1 parent e242072 commit 2785faa

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
@@ -3468,9 +3468,10 @@
34683468
The \defn{lifetime} of an object or reference is a runtime property of the
34693469
object or reference.
34703470
A variable is said to have \defnadj{vacuous}{initialization}
3471-
if it is default-initialized and,
3471+
if it is default-initialized, no other initialization is performed, and,
34723472
if it is of class type or a (possibly multidimensional) array thereof,
3473-
that class type has a trivial default constructor.
3473+
a trivial constructor of that class type is selected for
3474+
the default-initialization.
34743475
The lifetime of an object of type \tcode{T} begins when:
34753476
\begin{itemize}
34763477
\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)