diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.h b/clang-tools-extra/clang-tidy/ClangTidyModule.h --- a/clang-tools-extra/clang-tidy/ClangTidyModule.h +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.h @@ -65,11 +65,11 @@ /// Create instances of checks that are enabled. std::vector> - createChecks(ClangTidyContext *Context); + createChecks(ClangTidyContext *Context) const; /// Create instances of checks that are enabled for the current Language. std::vector> - createChecksForLanguage(ClangTidyContext *Context); + createChecksForLanguage(ClangTidyContext *Context) const; typedef llvm::StringMap FactoryMap; FactoryMap::const_iterator begin() const { return Factories.begin(); } diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp --- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp @@ -22,7 +22,7 @@ } std::vector> -ClangTidyCheckFactories::createChecks(ClangTidyContext *Context) { +ClangTidyCheckFactories::createChecks(ClangTidyContext *Context) const { std::vector> Checks; for (const auto &Factory : Factories) { if (Context->isCheckEnabled(Factory.getKey())) @@ -32,7 +32,8 @@ } std::vector> -ClangTidyCheckFactories::createChecksForLanguage(ClangTidyContext *Context) { +ClangTidyCheckFactories::createChecksForLanguage( + ClangTidyContext *Context) const { std::vector> Checks; const LangOptions &LO = Context->getLangOpts(); for (const auto &Factory : Factories) {