[clang] Surface error for plain return statement in coroutine earlier (PR #100985)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 04:25:10 PDT 2024


================
@@ -684,6 +684,19 @@ bool Sema::checkFinalSuspendNoThrow(const Stmt *FinalSuspend) {
   return ThrowingDecls.empty();
 }
 
+// [stmt.return.coroutine]p1:
+//   A coroutine shall not enclose a return statement ([stmt.return]).
+static void checkReturnStmtInCoroutine(Sema &S, FunctionScopeInfo *FSI) {
+  assert (!FSI && "FunctionScopeInfo is null");
----------------
ivanaivanovska wrote:

Right. No, assertions were off, so I missed it. I fixed that now. Thanks.

https://github.com/llvm/llvm-project/pull/100985


More information about the cfe-commits mailing list