[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 06:11:01 PST 2024


================
@@ -56,13 +56,16 @@
 #include "UniqueptrDeleteReleaseCheck.h"
 #include "UppercaseLiteralSuffixCheck.h"
 #include "UseAnyOfAllOfCheck.h"
+#include "UseStdMinMaxCheck.h"
 
 namespace clang::tidy {
 namespace readability {
 
 class ReadabilityModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
+    CheckFactories.registerCheck<UseStdMinMaxCheck>(
+        "readability-use-std-min-max");
----------------
5chmidti wrote:

Please sort this registration into the list of checks alphabetically (check the `CMakeLists.txt`, it is listed in the correct position there, right after `use-anyofallof`).

https://github.com/llvm/llvm-project/pull/77816


More information about the cfe-commits mailing list