================
@@ -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())) ||
----------------
a-tarasyuk wrote:

Since the declaration has `hasImplicitReturnZero`, analysis will be explicitly 
disabled for this case, and the following check won't apply

https://github.com/llvm/llvm-project/blob/8fddef8483dc9eb569580ffd13695b8f54d3c058/clang/lib/Sema/AnalysisBasedWarnings.cpp#L2738

https://github.com/llvm/llvm-project/blob/8fddef8483dc9eb569580ffd13695b8f54d3c058/clang/lib/Sema/AnalysisBasedWarnings.cpp#L2748


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

Reply via email to