Closed wg21bot closed 1 year ago
CWG 2022-11-07: Should be reviewed by EWG.
See P2647 cplusplus/papers#1318
Forward P2647R0 to CWG for inclusion in C++23, increasing __cpp_constexpr
in the process.
SF | F | N | A | SA |
---|---|---|---|---|
3 | 14 | 3 | 2 | 1 |
Result: Consensus
CWG 2022-11-08: Accepted with Modifications. See paper P2647R1 for details.
This is ill-formed:
[expr.const] (5.2) disallows "a control flow that passes through a declaration of a variable with static (6.7.5.2) or thread (6.7.5.3) storage duration;"
But the restriction is unnecessary if the variable can be constant initialized. This causes difficulties when implementing P2291R3, "Add Constexpr Modifiers to Functions to_chars and from_chars for Integral Types in
<charconv>
Header".Allow local static variables in constant expressions, if they are constant-initialized.