for loopsAuthors: Joseph Myers
Date: 2026-09-01
Submitted against: C2Y (N3886 draft)
Status: Review
As noted in reflector message
34193, the addition of
static assertions in expressions from
N3715
included syntactic disambiguation for block items, but not for the
first clause of a for statement. (As with that for block items,
this doesn't affect the final semantics of the static assertion, just
which sequence of syntax productions it goes through. There is no
such syntactic ambiguity in the selection header of if or switch.)
In 6.8.6.4 (The for statement), amend the second paragraph.
Both clause-1 and expression-3 can be omitted. If clause-1 is a static assertion, it is interpreted as a
static_assertdeclaration. An omitted expression-2 is replaced by a nonzero constant.
Comment from Issues list maintainer on 2026-11-25:
At the November 2026 (Búzios) meeting of WG14, the suggested correction was accepted, subject to review at the April 2027 meeting.
In 6.8.6.4 (The for statement), amend the second paragraph.
Both clause-1 and expression-3 can be omitted. If clause-1 is a static assertion, it is interpreted as a
static_assertdeclaration. An omitted expression-2 is replaced by a nonzero constant.