Skip to content

Commit 956d770

Browse files
committed
update PR for LWG 4133
1 parent 1568401 commit 956d770

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

xml/issue4133.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,70 @@ Also AS-EXCEPT-PTR can throw for the `error_code` case
3030
(that might be worth a separate issue though).
3131
</p>
3232

33+
<note>2026-03-27; Tim adds wording following LWG discussion</note>
34+
3335
</discussion>
3436

3537
<resolution>
38+
39+
40+
<p>
41+
This wording is relative to <paper num="N5032"/>.
42+
</p>
43+
44+
<ol>
45+
46+
<li><p>Modify <sref ref="[exec.as.awaitable]"/> as indicated:</p>
47+
48+
<blockquote>
49+
<p>
50+
-4- Let `rcvr` be an rvalue expression of type <tt><i>awaitable-receiver</i></tt>, let
51+
`crcvr` be a const lvalue that refers to `rcvr`, let `vs` be a pack of subexpressions,
52+
and let `err` be an expression of type `Err`. <ins>Let <code><i>MAKE-NOEXCEPT</i>(e)</code>
53+
for some subexpression `e` be expression-equivalent to
54+
<code>[] noexcept -&gt; decltype(auto) { return (e); }()</code>.</ins> Then:
55+
</p>
56+
<ol style="list-style-type: none">
57+
<li><p>(4.1) &mdash; If <tt>constructible_from&lt;<i>result-type</i>, decltype((vs))...&gt;</tt> is satisfied,
58+
the expression `set_value(rcvr, vs...)` is equivalent to:
59+
</p>
60+
<blockquote><pre>
61+
try {
62+
rcvr.<i>result-ptr</i>-&gt;template emplace&lt;1&gt;(vs...);
63+
} catch(...) {
64+
rcvr.<i>result-ptr</i>-&gt;template emplace&lt;2&gt;(current_exception());
65+
}
66+
<ins><i>MAKE-NOEXCEPT(</i></ins>rcvr.<i>continuation</i>.resume()<ins>)</ins>;
67+
</pre></blockquote>
68+
<p>
69+
Otherwise, `set_value(rcvr, vs...)` is ill-formed.</p></li>
70+
<li><p>(4.2) &mdash; The expression `set_error(rcvr, err)` is equivalent to:</p>
71+
72+
<blockquote><pre>
73+
<ins>try {</ins>
74+
rcvr.<i>result-ptr</i>-&gt;template emplace&lt;2&gt;(<i>AS-EXCEPT-PTR</i>(err));
75+
<ins>} catch(...) {
76+
rcvr.<i>result-ptr</i>-&gt;template emplace&lt;2&gt;(current_exception());
77+
}</ins>
78+
<ins><i>MAKE-NOEXCEPT(</i></ins>rcvr.<i>continuation</i>.resume()<ins>)</ins>;
79+
</pre></blockquote>
80+
</li>
81+
<li><p>(4.3) &mdash; The expression `set_stopped(rcvr)` is equivalent to:</p>
82+
<blockquote><pre>
83+
<ins><i>MAKE-NOEXCEPT(</i></ins>static_cast&lt;coroutine_handle&lt;&gt;&gt;(rcvr.continuation.promise().unhandled_stopped()).resume()<ins>)</ins>;
84+
</pre></blockquote>
85+
</li>
86+
<li><p>(4.4) &mdash; For any expression `tag` whose type satisfies <code><i>forwarding-query</i></code>
87+
and for any pack of subexpressions `as`, `get_env(crcvr).query(tag, as...)` is expression-equivalent to:</p>
88+
<blockquote><pre>
89+
tag(get_env(as_const(<ins><i>MAKE-NOEXCEPT(</i></ins>crcvr.continuation.promise()<ins>)</ins>)), as...)
90+
</pre></blockquote>
91+
</li>
92+
</ol>
93+
</blockquote>
94+
95+
</li>
96+
</ol>
3697
</resolution>
3798

3899
</issue>

0 commit comments

Comments
 (0)