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


3195. Starting the lifetime of a runtime object during constant evaluation

Section: 7.7.2  [expr.const.core]     Status: open     Submitter: LWG     Date: 2026-05-22

(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: