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

Nathan Sidwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 23 04:04:52 PST 2021


urnathan added inline comments.


================
Comment at: clang/lib/Sema/SemaCoroutine.cpp:1431-1432
+    //
+    // Then AnalysisBasedWarning would emit a warning about `foo()` lacks a
+    // co_return statements.
+    Fallthrough = S.ActOnNullStmt(PromiseRecordDecl->getLocation());
----------------
Your testcase doesnt show such a warning.  This seems unhelpful.  


================
Comment at: clang/lib/Sema/SemaCoroutine.cpp:1437-1440
     // If the unqualified-id 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.
     Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr,
----------------
there's some repetition in the comments.  Perhaps a bloc comment before the if-else sequence?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116204/new/

https://reviews.llvm.org/D116204



More information about the cfe-commits mailing list