================ @@ -3910,8 +3910,13 @@ StmtResult Sema::BuildReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, FnRetType = FD->getReturnType(); if (FD->hasAttrs()) Attrs = &FD->getAttrs(); - if (FD->isNoReturn()) - Diag(ReturnLoc, diag::warn_noreturn_function_has_return_expr) << FD; + if (FD->isNoReturn()) { + const FunctionScopeInfo *Scope = getEnclosingFunction(); + if (Scope && Scope->isCoroutine()) + Diag(ReturnLoc, diag::warn_noreturn_coroutine) << FD; + else + Diag(ReturnLoc, diag::warn_noreturn_function_has_return_expr) << FD; + } ---------------- Nerixyz wrote:
The diagnostic for noreturn functions was there before (i.e. your suggested change would remove it). I'm only adding a special message for coroutines. https://github.com/llvm/llvm-project/pull/127623 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits