Created on 2023-03-23.00:00:00 last changed 12 months ago
Proposed resolution (approved by CWG 2023-04-28):
Change in 7.7 [expr.const] bullet 5.30 as follows:
An expression E is a core constant expression unless the evaluation of E, following the rules of the abstract machine (6.9.1 [intro.execution]), would evaluate one of the following:
- ...
- a goto statement (8.7.6 [stmt.goto]). [ Note: A goto statement introduced by equivalence (Clause 8 [stmt.stmt]) is not in scope. For example, a while statement (8.6.2 [stmt.while]) can be executed during constant evaluation. -- end note ].
CWG 2023-03-30
Keep the rule non-normative and non-exhaustive.
Suggested resolution [SUPERSEDED]:
Change in 7.7 [expr.const] bullet 5.30 as follows:
An expression E is a core constant expression unless the evaluation of E, following the rules of the abstract machine (6.9.1 [intro.execution]), would evaluate one of the following:
[Accepted as a DR at the June, 2023 meeting.]
Iteration statements such as while and for loops are specified by equivalent code involving goto (8.6.2 [stmt.while] paragraph 2, 8.6.4 [stmt.for] paragraph 1, 8.6.5 [stmt.ranged] paragraph 1). The goto statement cannot be evaluated in constant expressions (7.7 [expr.const] bullet 5.30), thus while and for loops cannot be evaluated in constant expressions. Similar concerns arise for continue (8.7.3 [stmt.cont] paragraph 1).
However, that is neither intended nor existing practice.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-12-19 10:15:28 | admin | set | status: dr -> drwp |
2023-07-16 13:00:43 | admin | set | status: ready -> dr |
2023-04-28 19:41:23 | admin | set | status: review -> ready |
2023-03-31 21:39:35 | admin | set | messages: + msg7240 |
2023-03-31 21:39:35 | admin | set | messages: + msg7239 |
2023-03-31 21:39:35 | admin | set | status: open -> review |
2023-03-23 17:48:23 | admin | set | messages: + msg7235 |
2023-03-23 00:00:00 | admin | create |