From 3bca86170da0a7cadb4cc13b178ff1edf162ea8e Mon Sep 17 00:00:00 2001 From: Nathan James Date: Fri, 5 Mar 2021 15:35:24 +0000 Subject: [PATCH] [clang-tidy][NFC] Remove unsupported language version checks from vector --- clang-tools-extra/clang-tidy/ClangTidy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index f65e8ed..88ba4bf6 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -393,6 +393,10 @@ ClangTidyASTConsumerFactory::CreateASTConsumer( std::vector> Checks = CheckFactories->createChecks(&Context); + llvm::erase_if(Checks, [&](std::unique_ptr &Check) { + return !Check->isLanguageVersionSupported(Context.getLangOpts()); + }); + ast_matchers::MatchFinder::MatchFinderOptions FinderOptions; std::unique_ptr Profiling; @@ -416,8 +420,6 @@ ClangTidyASTConsumerFactory::CreateASTConsumer( } for (auto &Check : Checks) { - if (!Check->isLanguageVersionSupported(Context.getLangOpts())) - continue; Check->registerMatchers(&*Finder); Check->registerPPCallbacks(*SM, PP, ModuleExpanderPP); } -- 2.7.4