Created on 2022-06-27.00:00:00 last changed 29 months ago
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.
CWG 2022-11-09:
A deleted destructor does not prevent an aggregate from being an implicit-lifetime class.
Additional notes (September, 2022):
From a thread starting here: What if X had a deleted destructor (either explicitly or implicitly)?
[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.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
| 2023-07-16 13:00:43 | admin | set | status: drwp -> open |
| 2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
| 2022-11-25 05:14:04 | admin | set | status: ready -> dr |
| 2022-11-09 21:36:35 | admin | set | status: tentatively ready -> ready |
| 2022-11-09 21:36:35 | admin | set | messages: + msg7012 |
| 2022-11-09 21:36:35 | admin | set | status: tentatively ready -> tentatively ready |
| 2022-11-09 21:36:35 | admin | set | status: tentatively ready -> tentatively ready |
| 2022-11-09 21:36:35 | admin | set | messages: + msg6990 |
| 2022-11-09 21:36:35 | admin | set | status: tentatively ready -> tentatively ready |
| 2022-11-09 21:27:56 | admin | set | status: ready -> tentatively ready |
| 2022-11-09 21:27:56 | admin | set | status: ready -> ready |
| 2022-11-09 21:27:56 | admin | set | status: ready -> ready |
| 2022-09-01 14:43:59 | admin | set | messages: + msg6918 |
| 2022-08-19 07:54:33 | admin | set | status: open -> ready |
| 2022-06-27 00:00:00 | admin | create | |