Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

Identified with modernize-loop-convert.

Identified with modernize-loop-convert.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Nov 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2025

@llvm/pr-subscribers-clang-static-analyzer-1

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

Identified with modernize-loop-convert.


Full diff: https://github.com/llvm/llvm-project/pull/169175.diff

1 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp (+2-3)
diff --git a/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
index 7cc146ed29d0d..e71fe47bb8792 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
@@ -322,13 +322,12 @@ bool CallAndMessageChecker::PreVisitProcessArg(
         else {
           os << " (e.g., via the field chain: '";
           bool first = true;
-          for (SmallVectorImpl<const FieldDecl *>::iterator
-               DI = F.FieldChain.begin(), DE = F.FieldChain.end(); DI!=DE;++DI){
+          for (const FieldDecl *FD : F.FieldChain) {
             if (first)
               first = false;
             else
               os << '.';
-            os << **DI;
+            os << *FD;
           }
           os << "')";
         }

@kazutakahirata kazutakahirata merged commit 1c05dfb into llvm:main Nov 22, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251122_clang_tidy_modernize-loop-convert_StaticAnalyzer branch November 22, 2025 23:31
aadeshps-mcw pushed a commit to aadeshps-mcw/llvm-project that referenced this pull request Nov 26, 2025
Priyanshu3820 pushed a commit to Priyanshu3820/llvm-project that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants