[clang] e9fdc68 - [Clang][NFC] Remove unnecessary copy (#97902)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 17 08:18:36 PDT 2024
Author: smanna12
Date: 2024-07-17T10:18:32-05:00
New Revision: e9fdc689dbb141a318bb7be40001cef03ca67301
URL: https://github.com/llvm/llvm-project/commit/e9fdc689dbb141a318bb7be40001cef03ca67301
DIFF: https://github.com/llvm/llvm-project/commit/e9fdc689dbb141a318bb7be40001cef03ca67301.diff
LOG: [Clang][NFC] Remove unnecessary copy (#97902)
Reported by Static Analyzer Tool:
In
clang::ASTNodeImporter::VisitCountAttributedType(clang::CountAttributedType
const *): Using the auto keyword without an & causes the copy of an
object of type TypeCoupledDeclRefInfo
Added:
Modified:
clang/lib/AST/ASTImporter.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 4e1b3a5a94de7..0c27f6f5df2da 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -1551,7 +1551,7 @@ ASTNodeImporter::VisitCountAttributedType(const CountAttributedType *T) {
Expr *CountExpr = importChecked(Err, T->getCountExpr());
SmallVector<TypeCoupledDeclRefInfo, 1> CoupledDecls;
- for (auto TI : T->dependent_decls()) {
+ for (const TypeCoupledDeclRefInfo &TI : T->dependent_decls()) {
Expected<ValueDecl *> ToDeclOrErr = import(TI.getDecl());
if (!ToDeclOrErr)
return ToDeclOrErr.takeError();
More information about the cfe-commits
mailing list