[expr.const]/2.11 CWG 2186: "Preceding" is unclear #2307
Labels
cwg
Issue must be reviewed by CWG.
not-editorial
Issue is not deemed editorial; the editorial issue is kept open for tracking.
[expr.const]/2.11:
It's unclear what "preceding" means. It may either mean the initialization happens before the evaluation of the id-expression, or mean the initialization occurs before the id-expression in lexical order.
According to this example in cppreference:
It seems "preceding" means the latter, but consider:
Here
f(0)
is obviously a constant expression, but the initialization ofi
does not occur beforereturn i;
in lexical order.I think it makes more sense to say:
The text was updated successfully, but these errors were encountered: