CWG Issue 2668 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-04-13
2668.co_await in a lambda-expression
Section: 7.6.2.4 [expr.await]Status: DRWPSubmitter: Jim XDate: 2022-12-12
[Accepted as a DR at the March, 2024 meeting.]
Subclause 7.6.2.4 [expr.await] paragraph 2 disallows an await-expression to appear in the body of a lambda-expression:
An await-expression shall appear only in a potentially-evaluated expression within the _compound-statement_of a function-body outside of a handler (14.1 [except.pre]). ...
This is probably unintended.
Proposed resolution (approved by CWG 2023-11-11):
Change in 7.6.2.4 [expr.await] paragraph 2 as follows:
An await-expression shall appear only
inas a potentially-evaluated expression within the compound-statement of a function-body or lambda-expression, in either case outside of a handler (14.1 [except.pre]). ...