Created on 2025-11-06.00:00:00 last changed 4 days ago
Proposed resolution:
This wording is relative to N5032.
Modify [assertions.assert] as indicated:
-3- If `__VA_ARGS__` does not expand to
ana well-formed assignment-expression, the program is ill-formed. If such an assignment-expression is ill-formed when treated as an unevaluated operand ([expr.await], [expr.yield]), the program is ill-formed, no diagnostic required.
[ 2026-03-06 LWG telecon; move to Ready ]
[ 2026-03-06 Tim provides wording ]
The new implementation of `assert` introduced by P2264R7 might require something like `sizeof(bool(__VA_ARGS__))`. Using something like `assert((co_yield 1, true))` would be ill-formed if the implementation of `assert` uses `sizeof`, because `co_yield` cannot appear in an unevaluated context.
The specification for `assert` should forbid using any constructs which are not valid in unevaluated contexts, unless we are certain that the new `assert` requirements can be implemented without such tricks using unevaluated contexts. "Ill-formed; no diagnostic required" seems appropriate.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-03-06 16:58:22 | admin | set | messages: + msg16010 |
| 2026-03-06 16:58:22 | admin | set | status: new -> ready |
| 2026-03-06 15:45:48 | admin | set | messages: + msg16009 |
| 2026-03-06 15:45:48 | admin | set | messages: + msg16008 |
| 2025-11-06 00:00:00 | admin | create | |