2019-10-03 06:39:46 +08:00
|
|
|
//===--- UseAnyOfAllOfCheck.h - clang-tidy-----------------------*- C++ -*-===//
|
|
|
|
//
|
2021-08-05 11:16:17 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-10-03 06:39:46 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
|
|
|
|
|
2020-06-29 23:05:51 +08:00
|
|
|
#include "../ClangTidyCheck.h"
|
2019-10-03 06:39:46 +08:00
|
|
|
#include "../utils/IncludeInserter.h"
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
|
|
|
namespace readability {
|
|
|
|
|
|
|
|
/// Finds ranged-based for loops that can be replaced by a call to std::any_of
|
|
|
|
/// or std::all_of.
|
|
|
|
///
|
|
|
|
/// For the user-facing documentation see:
|
2022-05-19 03:29:27 +08:00
|
|
|
/// http://clang.llvm.org/extra/clang-tidy/checks/readability/use-anyofallof.html
|
2019-10-03 06:39:46 +08:00
|
|
|
class UseAnyOfAllOfCheck : public ClangTidyCheck {
|
|
|
|
public:
|
|
|
|
using ClangTidyCheck::ClangTidyCheck;
|
|
|
|
|
|
|
|
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
|
|
|
|
return LangOpts.CPlusPlus11;
|
|
|
|
}
|
|
|
|
|
|
|
|
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
|
|
|
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace readability
|
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|
|
|
|
|
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
|