[PATCH] D116204: [C++20] [Coroutines] Allow promise_type to not define return_void or return_value

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 22 22:23:41 PST 2021

ChuanqiXu created this revision.
ChuanqiXu added reviewers: rjmccall, lxfind, Quuxplusone, urnathan.
ChuanqiXu added a project: clang.
ChuanqiXu requested review of this revision.
Herald added a subscriber: cfe-commits.

According to [[dcl.fct.def.coroutine]p6](http://eel.is/c++draft/dcl.fct.def.coroutine#6), the promise_type is allowed to not define return_void or 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]

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116204.395976.patch
Type: text/x-patch
Size: 5146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211223/59c7413a/attachment.bin>

More information about the cfe-commits mailing list