================ @@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr<NakedAttr>()) + if ((FD->hasImplicitReturnZero() && + (getLangOpts().CPlusPlus || getLangOpts().C99 || !FD->isMain())) || ---------------- AaronBallman wrote:
This change looks wrong to me. We shouldn't have to look at the language options and whether the function is or isn't `main`, the point is to rely on `hasImplicitReturnZero()` alone. Pretty sure the fallthrough checker is what should be handling silencing the diagnostic. https://github.com/llvm/llvm-project/pull/134617 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits