CWG Issue 2552 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-07
2552. Constant evaluation of non-defining variable declarations
Section: 7.7 [expr.const]Status: CD7Submitter: Hubert TongDate: 2022-03-21
[Accepted as a DR at the June, 2023 meeting.]
PaperP2242(Non-literal variables (and labels and gotos) in constexpr functions) added 7.7 [expr.const] bullet 5.2:
- a control flow that passes through a declaration of a variable with static (6.8.6.2 [basic.stc.static]) or thread (6.8.6.3 [basic.stc.thread]) storage duration;
It seems that block-scope extern (i.e. non-defining) declarations are covered by the above bullet, but only definitions should be in view here.
Proposed resolution (approved by CWG 2023-06-15):
- Change in 7.7 [expr.const] bullet 5.2 as follows:
- a control flow that passes through a declaration of a blockvariable (6.4.3 [basic.scope.block]) with static (6.8.6.2 [basic.stc.static]) or thread (6.8.6.3 [basic.stc.thread]) storage duration;