aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmanna12 <soumi.manna@intel.com>2024-03-27 16:44:41 -0500
committerGitHub <noreply@github.com>2024-03-27 16:44:41 -0500
commit5da39372e39f3aebf63e07faf774b6ed37cad3fb (patch)
tree4f1f60a534d1af2a69923c1d16b7e73dcc0d5389
parenta8b90c047d5bb47702eebd4ceeb763e8537981a1 (diff)
downloadllvm-5da39372e39f3aebf63e07faf774b6ed37cad3fb.zip
llvm-5da39372e39f3aebf63e07faf774b6ed37cad3fb.tar.gz
llvm-5da39372e39f3aebf63e07faf774b6ed37cad3fb.tar.bz2
[clang-installapi] Remove unnecessary copy (#86808)
Reported by Static Analyzer Tool: In clang::installapi::InstallAPIVisitor::VisitFunctionDecl(clang::FunctionDecl const *): Using the auto keyword without an & causes the copy of an object of type DynTypedNode.
-rw-r--r--clang/lib/InstallAPI/Visitor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/InstallAPI/Visitor.cpp b/clang/lib/InstallAPI/Visitor.cpp
index f8f5d8d..6476c51 100644
--- a/clang/lib/InstallAPI/Visitor.cpp
+++ b/clang/lib/InstallAPI/Visitor.cpp
@@ -255,7 +255,7 @@ bool InstallAPIVisitor::VisitFunctionDecl(const FunctionDecl *D) {
return true;
// Skip methods in CXX RecordDecls.
- for (auto P : D->getASTContext().getParents(*M)) {
+ for (const DynTypedNode &P : D->getASTContext().getParents(*M)) {
if (P.get<CXXRecordDecl>())
return true;
}