[clang] [Sema] Suggest missing format attributes (PR #166738)

Vladimir Vuksanovic via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 27 00:03:19 PST 2025


================
@@ -7093,9 +7105,143 @@ bool Sema::CheckFormatString(const FormatMatchesAttr *Format,
   return false;
 }
 
+static bool CheckMissingFormatAttribute(
+    Sema *S, ArrayRef<const Expr *> Args, Sema::FormatArgumentPassingKind APK,
+    StringLiteral *ReferenceFormatString, unsigned FormatIdx,
+    unsigned FirstDataArg, FormatStringType FormatType, unsigned CallerParamIdx,
+    SourceLocation Loc) {
+  if (S->getDiagnostics().isIgnored(diag::warn_missing_format_attribute,
+                                    SourceLocation()))
----------------
vvuksanovic wrote:

I changed that by accident, it should be `Loc`. Fixed now,

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


More information about the cfe-commits mailing list