This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2026-06-01
(From LWG issue 4578.)
Consider:
union U { int x = 10; float f[2]; };
U u;
consteval {
std::start_lifetime(u.f); // changes active member
};
void foo() {
U u;
constexpr int x = (std::start_lifetime(u.f), 10);
}
There is no prohibition against explicitly starting the lifetime of a runtime object during constant evaluation.
Suggested resolution:
Insert a bullet after 7.7.2 [expr.const.core] bullet 2.18 as follows:
- ...
- an invocation of a destructor (11.4.7 [class.dtor]) or a function call whose postfix-expression names a pseudo-destructor (7.6.1.3 [expr.call]), in either case for an object whose lifetime did not begin within the evaluation of E;
- starting the lifetime of an object O such that the lifetime of the complete object of O did not begin within the evaluation of E;
- ...