[PATCH] D112569: -Wformat-nonliteral should not trigger for format strings passed to blocks with __attribute__((format))

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 12:24:38 PDT 2021


NoQ added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:7785
+            int PVIndex = 1;
+            if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
+              PVIndex += PV->getFunctionScopeIndex();
----------------
This code now says that all block parameters have index 1 because blocks aren't named(?) I don't think this is correct. I also don't see why this cast is necessary in the first place. The only place where `ND` is used is the cast into `MD` which might as well be performed on `D` directly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112569/new/

https://reviews.llvm.org/D112569



More information about the cfe-commits mailing list