================
@@ -3747,6 +3747,16 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr
*RetValExp,
Diag(ReturnLoc, diag::err_acc_branch_in_out_compute_construct)
<< /*return*/ 1 << /*out of */ 0);
+ // using plain return in a coroutine is not allowed.
+ FunctionScopeInfo *FSI = getCurFunction();
+ if (getLangOpts().Coroutines && FSI->isCoroutine()) {
----------------
ilya-biryukov wrote:
Could we only do this when `FSI->FirstReturnLoc.isInvalid() == true` to make
sure we do not start producing the error on every return statement?
Previously we only produced a single error, and this seems like a useful
behavior to keep. Otherwise we're spamming people with error messages.
https://github.com/llvm/llvm-project/pull/100985
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits