If the initialization of an object
other than by delegating constructor
is terminated by an exception,
the destructor is invoked for
each of the object's subobjects
that were known to be initialized by the object's initialization and
whose initialization has completed (
[dcl.init])
. [
Note 1:
If such an object has a reference member
that extends the lifetime of a temporary object,
this ends the lifetime of the reference member,
so the lifetime of the temporary object is effectively not extended
. —
end note]
[
Note 2:
This includes virtual base class subobjects
if the initialization
is for a complete object, and
can include variant members
that were nominated explicitly by
a
mem-initializer or
designated-initializer-clause or
that have a default member initializer
. —
end note]
If the destructor of an object is terminated by an exception,
each destructor invocation
that would be performed after executing the body of the destructor (
[class.dtor]) and
that has not yet begun execution
is performed
. [
Note 3:
This includes virtual base class subobjects if
the destructor was invoked for a complete object
. —
end note]
The subobjects are destroyed in the reverse order of the completion of
their construction
. Such destruction is sequenced before entering a
handler of the
function-try-block of the constructor or destructor,
if any
.