Skip to content

Commit abb1471

Browse files
committed
New issue from Jonathan: assert should forbit co_await and co_yield
1 parent d0bd986 commit abb1471

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

xml/issue4454.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4454" status="New">
5+
<title>`assert` should forbid `co_await` and `co_yield`</title>
6+
<section><sref ref="[assertions.assert]"/></section>
7+
<submitter>Jonathan Wakely</submitter>
8+
<date>06 Nov 2025</date>
9+
<priority>1</priority>
10+
11+
<discussion>
12+
<b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/708">GB 05-129</a></b>
13+
<p>
14+
The new implementation of `assert` introduced by <paper num="P2264R7"/>
15+
might require something like `sizeof(bool(__VA_ARGS__))`.
16+
Using something like `assert((co_yield 1, true))` would be ill-formed
17+
if the implementation of `assert` uses `sizeof`, because `co_yield` cannot
18+
appear in an unevaluated context.
19+
</p>
20+
<p>
21+
The specification for `assert` should forbid using any constructs which
22+
are not valid in unevaluated contexts, unless we are certain that the
23+
new `assert` requirements can be implemented without such tricks using
24+
unevaluated contexts. "Ill-formed; no diagnostic required" seems appropriate.
25+
</p>
26+
</discussion>
27+
28+
<resolution>
29+
<p>
30+
</p>
31+
</resolution>
32+
33+
</issue>

0 commit comments

Comments
 (0)