Title
`assert` should forbid `co_await` and `co_yield`
Status
new
Section
[assertions.assert]
Submitter
Jonathan Wakely

Created on 2025-11-06.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-06.00:00:00
Addresses GB 05-129

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
2025-11-06 00:00:00admincreate