This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4359. as_awaitable(expr, p) does not define semantics of call if p is not an lvalue

Section: 33.13.1 [exec.as.awaitable] Status: New Submitter: Lewis Baker Opened: 2025-08-27 Last modified: 2025-09-14

Priority: Not Prioritized

View other active issues in [exec.as.awaitable].

View all other issues in [exec.as.awaitable].

View all issues with New status.

Discussion:

The wording in 33.13.1 [exec.as.awaitable] p7 defines the semantics of a call to as_awaitable(expr, p) where p is an lvalue. However, it does not specify what the behaviour is if p is not an lvalue.

We should probably say that as_awaitable(expr, p) is ill-formed if p is not an lvalue.

Proposed resolution:

This wording is relative to N5014.

  1. Modify 33.13.1 [exec.as.awaitable] as indicated:

    -7- as_awaitable is a customization point object. For subexpressions expr and p where p is an lvalue, Expr names the type decltype((expr)) and Promise names the type decay_t<decltype((p))>, if p is not an lvalue, as_awaitable(expr, p) is ill-formed, otherwise as_awaitable(expr, p) is expression-equivalent to, except that the evaluations of expr and p are indeterminately sequenced: