diff options
6 files changed, 11 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp index e1e798ddccf..3a3ae82e6a9 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp @@ -18,7 +18,7 @@ namespace tidy { void ClangTidyCheckFactories::registerCheckFactory(StringRef Name, CheckFactory Factory) { - Factories[Name] = Factory; + Factories[Name] = std::move(Factory); } void ClangTidyCheckFactories::createChecks( diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp index e3095fe536e..0714516edf5 100644 --- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp @@ -29,7 +29,8 @@ void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) { // Looks for the token matching the predicate and returns the range of the found // token including trailing whitespace. -static SourceRange FindToken(const SourceManager &Sources, LangOptions LangOpts, +static SourceRange FindToken(const SourceManager &Sources, + const LangOptions &LangOpts, SourceLocation StartLoc, SourceLocation EndLoc, bool (*Pred)(const Token &)) { if (StartLoc.isMacroID() || EndLoc.isMacroID()) diff --git a/clang-tools-extra/clang-tidy/misc/DanglingHandleCheck.cpp b/clang-tools-extra/clang-tidy/misc/DanglingHandleCheck.cpp index ed2527e42cf..97d23e0e0cf 100644 --- a/clang-tools-extra/clang-tidy/misc/DanglingHandleCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/DanglingHandleCheck.cpp @@ -21,14 +21,14 @@ namespace misc { namespace { ast_matchers::internal::BindableMatcher<Stmt> -handleFrom(ast_matchers::internal::Matcher<RecordDecl> IsAHandle, - ast_matchers::internal::Matcher<Expr> Arg) { +handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle, + const ast_matchers::internal::Matcher<Expr> &Arg) { return cxxConstructExpr(hasDeclaration(cxxMethodDecl(ofClass(IsAHandle))), hasArgument(0, Arg)); } ast_matchers::internal::Matcher<Stmt> handleFromTemporaryValue( - ast_matchers::internal::Matcher<RecordDecl> IsAHandle) { + const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) { // If a ternary operator returns a temporary value, then both branches hold a // temporary value. If one of them is not a temporary then it must be copied // into one to satisfy the type of the operator. @@ -54,8 +54,8 @@ ast_matchers::internal::Matcher<RecordDecl> isAMap() { "::std::unordered_multimap"); } -ast_matchers::internal::BindableMatcher<Stmt> -makeContainerMatcher(ast_matchers::internal::Matcher<RecordDecl> IsAHandle) { +ast_matchers::internal::BindableMatcher<Stmt> makeContainerMatcher( + const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) { // This matcher could be expanded to detect: // - Constructors: eg. vector<string_view>(3, string("A")); // - emplace*(): This requires a different logic to determine that diff --git a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp index 78438cb2047..e3e82d717d5 100644 --- a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp @@ -186,7 +186,7 @@ getParameterSourceDeclaration(const FunctionDecl *OriginalDeclaration) { std::string joinParameterNames( const DifferingParamsContainer &DifferingParams, - std::function<StringRef(const DifferingParamInfo &)> ChooseParamName) { + llvm::function_ref<StringRef(const DifferingParamInfo &)> ChooseParamName) { llvm::SmallVector<char, 40> Buffer; llvm::raw_svector_ostream Str(Buffer); bool First = true; diff --git a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp index e3686359fa0..f36ed8219f4 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp @@ -18,7 +18,7 @@ namespace tidy { namespace readability { namespace { -internal::Matcher<Expr> callToGet(internal::Matcher<Decl> OnClass) { +internal::Matcher<Expr> callToGet(const internal::Matcher<Decl> &OnClass) { return cxxMemberCallExpr( on(expr(anyOf(hasType(OnClass), hasType(qualType( diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 2662241024a..d2959175629 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -338,7 +338,7 @@ static int clangTidyMain(int argc, const char **argv) { return 1; } llvm::outs() << "Enabled checks:"; - for (auto CheckName : EnabledChecks) + for (const auto &CheckName : EnabledChecks) llvm::outs() << "\n " << CheckName; llvm::outs() << "\n\n"; return 0; |

