-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Reference (section label)
[stmt.return.coroutine]
Link to reflector thread (if any)
https://lists.isocpp.org/core/2020/09/9958.php
Issue description
The note in [dcl.fct.def.coroutine]/6 suggests that the existence of promise::return_void
causes flowing off the end of a coroutine to be well-defined. [stmt.return.coroutine]/3, however, actually checks whether calling it with no arguments is a valid expression (presumably from the coroutine). As such, a return_void that is inaccessible, deleted, or requires arguments will produce undefined behavior even though the implementation knows that return_void
was "intended" (since no return_value
can coexist with it). This seems unnecessarily user-hostile.
Suggested resolution
Say in [stmt.return.coroutine]/3 that p.return_void()
is used if name lookup succeeded even if it's ill-formed.