diff options
author | Matthias Gehre <gehre.matthias@gmail.com> | 2019-10-03 00:39:46 +0200 |
---|---|---|
committer | Matthias Gehre <gehre.matthias@gmail.com> | 2020-06-03 12:19:06 +0200 |
commit | add51e152aa6dc3aa7a51901a099b2ebe8cfe377 (patch) | |
tree | 93c2955a830fc68a296a02c15c5d978fe3871d47 /clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp | |
parent | e6ba0a55fd39b600f3f431308f4a7e36e48f91ae (diff) | |
download | llvm-add51e152aa6dc3aa7a51901a099b2ebe8cfe377.zip llvm-add51e152aa6dc3aa7a51901a099b2ebe8cfe377.tar.gz llvm-add51e152aa6dc3aa7a51901a099b2ebe8cfe377.tar.bz2 |
[clang-tidy] add new check readability-use-anyofallof
Summary:
Finds range-based for loops that can be replaced by a call to ``std::any_of`` or
``std::all_of``. In C++ 20 mode, suggests ``std::ranges::any_of`` or
``std::ranges::all_of``.
For now, no fixits are produced.
Reviewers: aaron.ballman, alexfh, hokein
Subscribers: mgorny, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77572
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp index 5ece15e..5ff5e20 100644 --- a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp @@ -45,6 +45,7 @@ #include "StringCompareCheck.h" #include "UniqueptrDeleteReleaseCheck.h" #include "UppercaseLiteralSuffixCheck.h" +#include "UseAnyOfAllOfCheck.h" namespace clang { namespace tidy { @@ -125,6 +126,8 @@ public: "readability-uniqueptr-delete-release"); CheckFactories.registerCheck<UppercaseLiteralSuffixCheck>( "readability-uppercase-literal-suffix"); + CheckFactories.registerCheck<UseAnyOfAllOfCheck>( + "readability-use-anyofallof"); } }; |