clang-tools  11.0.0
UseAnyOfAllOfCheck.h
Go to the documentation of this file.
1 //===--- UseAnyOfAllOfCheck.h - clang-tidy-----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
12 
13 #include "../ClangTidyCheck.h"
14 #include "../utils/IncludeInserter.h"
15 
16 namespace clang {
17 namespace tidy {
18 namespace readability {
19 
20 /// Finds ranged-based for loops that can be replaced by a call to std::any_of
21 /// or std::all_of.
22 ///
23 /// For the user-facing documentation see:
24 /// http://clang.llvm.org/extra/clang-tidy/checks/readability-use-anyofallof.html
26 public:
28 
29  bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
30  return LangOpts.CPlusPlus11;
31  }
32 
33  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
34  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
35 };
36 
37 } // namespace readability
38 } // namespace tidy
39 } // namespace clang
40 
41 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
clang::tidy::ClangTidyCheck::ClangTidyCheck
ClangTidyCheck(StringRef CheckName, ClangTidyContext *Context)
Initializes the check with CheckName and Context.
Definition: ClangTidyCheck.cpp:48
clang::tidy::readability::UseAnyOfAllOfCheck::isLanguageVersionSupported
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
Definition: UseAnyOfAllOfCheck.h:29
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidyCheck.h:114
clang::tidy::readability::UseAnyOfAllOfCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: UseAnyOfAllOfCheck.cpp:90
clang::tidy::readability::UseAnyOfAllOfCheck
Finds ranged-based for loops that can be replaced by a call to std::any_of or std::all_of.
Definition: UseAnyOfAllOfCheck.h:25
clang::tidy::readability::UseAnyOfAllOfCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition: UseAnyOfAllOfCheck.cpp:44
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27