Issue 1101: Static assertions in expressions in for loops

Authors: Joseph Myers
Date: 2026-09-01
Submitted against: C2Y (N3886 draft)
Status: Open

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.)

Suggested correction

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_assert declaration. An omitted expression-2 is replaced by a nonzero constant.