Skip to content

Commit 48f68a4

Browse files
author
Dawn Perchik
committed
CWG2227 Destructor access and default member initializers
1 parent 55d959d commit 48f68a4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

source/declarators.tex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,6 +3160,16 @@
31603160
An aggregate that is a class can also be initialized with a single
31613161
expression not enclosed in braces, as described in~\ref{dcl.init}.
31623162

3163+
\pnum
3164+
The destructor for each element of class type
3165+
is potentially invoked\iref{class.dtor}
3166+
from the context where the aggregate initialization occurs.
3167+
\begin{note}
3168+
This provision ensures that destructors can be called
3169+
for fully-constructed subobjects
3170+
in case an exception is thrown\iref{except.ctor}.
3171+
\end{note}
3172+
31633173
\pnum
31643174
An array of unknown bound initialized with a
31653175
brace-enclosed

source/special.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,8 +1206,8 @@
12061206
\begin{note} An array of class type contains several subobjects for each of which
12071207
the destructor is invoked. \end{note}
12081208
A destructor can also be invoked explicitly. A destructor is \term{potentially invoked}
1209-
if it is invoked or as specified in~\ref{expr.new}, \ref{class.base.init},
1210-
and~\ref{except.throw}.
1209+
if it is invoked or as specified in~\ref{expr.new}, \ref{dcl.init.aggr},
1210+
\ref{class.base.init}, and~\ref{except.throw}.
12111211
A program is ill-formed if a destructor that is potentially invoked is deleted
12121212
or not accessible from the context of the invocation.
12131213

0 commit comments

Comments
 (0)