Created on 2022-02-08.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2022-12-02):
Change in 9.2.6 [dcl.constexpr] paragraph 7 as follows:
A constexpr specifier used in an object declaration declares the object as const. Such an object shall have literal type and shall be initialized. In any constexpr variable declaration, the full-expression of the initialization shall be a constant expression (7.7 [expr.const]). A constexpr variable that is an object, as well as any temporary to which a constexpr reference is bound, shall have constant destruction. [ Example: ... ]
[Accepted as a DR at the February, 2023 meeting.]
According to 9.2.6 [dcl.constexpr] paragraph 10, a constexpr variable must have constant destruction. However, 7.7 [expr.const] paragraph 7 only defines constant destruction for objects, not for references. Presumably constexpr references should also be able to have constant destruction, and any temporary object to which such a reference is bound should also be required to have constant destruction.
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: dr -> open |
2023-02-18 18:43:04 | admin | set | status: ready -> dr |
2023-02-06 20:45:44 | admin | set | status: tentatively ready -> ready |
2022-12-03 20:33:18 | admin | set | messages: + msg7078 |
2022-12-03 20:33:18 | admin | set | status: drafting -> tentatively ready |
2022-11-20 07:54:16 | admin | set | status: open -> drafting |
2022-02-08 00:00:00 | admin | create |