Title
`as_awaitable(expr, p)` does not define semantics of call if `p` is not an lvalue
Status
new
Section
[exec.as.awaitable]
Submitter
Lewis Baker

Created on 2025-08-27.00:00:00 last changed 3 days ago

Messages

Date: 2025-09-14.12:55:54

Proposed resolution:

This wording is relative to N5014.

  1. Modify [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:

Date: 2025-08-27.00:00:00

The wording in [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.

History
Date User Action Args
2025-09-14 12:55:54adminsetmessages: + msg15034
2025-08-27 00:00:00admincreate