[clang] Update Catch missing format attributes (PR #106649)

Budimir Aranđelović via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 00:54:03 PDT 2024


================
@@ -5506,16 +5509,13 @@ Sema::GetMissingFormatAttributes(Stmt *Body, const FunctionDecl *FDecl) {
     }
 
     // Get first argument index
-    unsigned FirstToCheck = [&]() -> unsigned {
+    int FirstToCheck = [&]() -> unsigned {
       if (!FDecl->isVariadic())
         return 0;
-      const auto *FirstToCheckArg =
-          dyn_cast<DeclRefExpr>(Args[NumArgs - 1]->IgnoreParenCasts());
----------------
budimirarandjelovichtec wrote:

I removed dynamic cast to DeclRefAttr of last function argument. In C++ mode casting to DeclRefAttr resulted in unrecognizing argument type as va_list for several architectures and OS.

https://github.com/llvm/llvm-project/pull/106649


More information about the cfe-commits mailing list