[C++20] [Coroutines] Allow promise_type to not define return_void or return_value
According to [dcl.fct.def.coroutine]p6, the promise_type is allowed to not define return_void nor return_value: > If searches for the names return_void and return_value in the scope > of the promise type each find any declarations, the program is > ill-formed. > [Note 1: If return_void is found, flowing off the end of a coroutine is > equivalent to a co_return with no operand. Otherwise, flowing off the > end of a coroutine results in > undefined behavior ([stmt.return.coroutine]). — end note] So the program isn't ill-formed if the promise_type doesn't define return_void nor return_value. It is just a potential UB. So the program should be allowed to compile. Reviewed By: urnathan Differential Revision: https://reviews.llvm.org/D116204
Loading
Please sign in to comment