[llvm-branch-commits] [clang] [analyzer][NFC] Index parameter lookups by argument position (PR #221977)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 14 05:13:56 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
index 8c98ec256..23d43ee50 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
@@ -587,7 +587,8 @@ ProgramStateRef CallAndMessageChecker::checkArgInitializedness(
// object the way it does for implicit `this`, so it stays a regular argument.
// Indexing still lines up today only by coincidence, because parameters()
// includes it too.
- for (unsigned NativeIdx = 0, e = Call.getNumArgs(); NativeIdx != e; ++NativeIdx) {
+ for (unsigned NativeIdx = 0, e = Call.getNumArgs(); NativeIdx != e;
+ ++NativeIdx) {
// For variadic functions a corresponding parameter decl might not exist.
const ParmVarDecl *PVD =
NativeIdx < Params.size() ? Params[NativeIdx] : nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/221977
More information about the llvm-branch-commits
mailing list