================
@@ -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:
Oh I see what's going on, thank you for the explanation. Then I think all
that's needed here is a comment saying something along the lines of: Clang
implicitly returns 0 in C89 mode, but that's an extension, so we need to
perform the check in that case to ensure we emit the expected extension warning
in C89 mode.
https://github.com/llvm/llvm-project/pull/134617
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits