This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112c. See for the official list.


1285. Trivial destructors and object lifetime

Section: 6.7.3  []     Status: NAD     Submitter: Johannes Schaub     Date: 2011-04-02

The Standard is self-contradictory regarding which destructor calls end the lifetime of an object. 6.7.3 [] paragraph 1 says,

The lifetime of an object of type T ends when:

i.e., the lifetime of an object of a class type with a trivial destructor persists until its storage is reused or released. However, 11.4.7 [class.dtor] paragraph 15 says,

Once a destructor is invoked for an object, the object no longer exists; the behavior is undefined if the destructor is invoked for an object whose lifetime has ended (6.7.3 []).

implying that invoking any destructor, even a trivial one, ends the lifetime of the associated object. Similarly, 11.9.5 [class.cdtor] paragraph 1 says,

For an object with a non-trivial destructor, referring to any non-static member or base class of the object after the destructor finishes execution results in undefined behavior.

A similar question arises for pseudo-destructors for non-class types.

Notes from the August, 2011 meeting:

CWG will need a paper exploring this topic before it can act on the issue.

Rationale (February, 2021):

The resolution of issue 2256 makes it clear that the destruction of an object, no matter how accomplished, ends its lifetime.