================ @@ -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:
The `getLangOpts().Coroutines` check looks redundant. I don't think we can ever produce a coroutine in the AST if `getLangOpts().Coroutines == false`, or do we? ```suggestion if (FSI->isCoroutine()) { ``` https://github.com/llvm/llvm-project/pull/100985 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits