diff --git a/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h b/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h --- a/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h +++ b/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h @@ -172,7 +172,7 @@ SmallVector getBases(const CXXRecordDecl *Decl) { // FIXME: store AccessSpecifier given by inheritance SmallVector Bases; - for (const auto BaseSpecifier : Decl->bases()) { + for (const auto &BaseSpecifier : Decl->bases()) { // skip classes not inherited as public if (BaseSpecifier.getAccessSpecifier() != AccessSpecifier::AS_public) continue; diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp --- a/clang/lib/Analysis/UnsafeBufferUsage.cpp +++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp @@ -2295,7 +2295,7 @@ // Variables will be removed from `FixItsForVariable`: SmallVector ToErase; - for (auto [VD, Ignore] : FixItsForVariable) { + for (const auto &[VD, Ignore] : FixItsForVariable) { VarGrpRef Grp = VarGrpMgr.getGroupOfVar(VD); if (llvm::any_of(Grp, [&FixItsForVariable](const VarDecl *GrpMember) -> bool { diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -900,7 +900,7 @@ return; Symbols.emplace_back(std::move(*Class)); - for (const auto Base : Record.Bases) + for (const auto &Base : Record.Bases) serializeRelationship(RelationshipKind::InheritsFrom, Record, Base); if (!Record.ParentInformation.empty()) serializeRelationship(RelationshipKind::MemberOf, Record, @@ -914,7 +914,7 @@ return; Symbols.emplace_back(std::move(*Class)); - for (const auto Base : Record.Bases) + for (const auto &Base : Record.Bases) serializeRelationship(RelationshipKind::InheritsFrom, Record, Base); if (!Record.ParentInformation.empty()) serializeRelationship(RelationshipKind::MemberOf, Record, @@ -929,7 +929,7 @@ Symbols.emplace_back(std::move(*Class)); - for (const auto Base : Record.Bases) + for (const auto &Base : Record.Bases) serializeRelationship(RelationshipKind::InheritsFrom, Record, Base); if (!Record.ParentInformation.empty()) serializeRelationship(RelationshipKind::MemberOf, Record, @@ -944,7 +944,7 @@ Symbols.emplace_back(std::move(*Class)); - for (const auto Base : Record.Bases) + for (const auto &Base : Record.Bases) serializeRelationship(RelationshipKind::InheritsFrom, Record, Base); if (!Record.ParentInformation.empty()) serializeRelationship(RelationshipKind::MemberOf, Record,