This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
[Accepted as a DR at the November, 2022 meeting.]
Subclause 11.2 [class.prop] paragraph 9 specifies:
A class S is an implicit-lifetime class if
- it is an aggregate or
- it has at least one trivial eligible constructor and a trivial, non-deleted destructor.
However, an aggregate may have a non-deleted non-trivial destructor:
struct X { Y i; ~X(); };
This class is an aggregate, but destroying X itself (ignoring the subobjects) does not satisfy "destroying an instance of the type runs no code"; see P0593R6 "Implicit creation of objects for low-level object manipulation" section 3.1.
Additional notes (September, 2022):
From a thread starting here: What if X had a deleted destructor (either explicitly or implicitly)?
CWG 2022-11-09:
A deleted destructor does not prevent an aggregate from being an implicit-lifetime class.
Proposed resolution (approved by CWG 2022-11-09):
Change in 11.2 [class.prop] paragraph 9 as follows:
A class S is an implicit-lifetime class if
- it is an aggregate whose destructor is not user-provided or
- it has at least one trivial eligible constructor and a trivial, non-deleted destructor.