[clang] [clang-tools-extra] [llvm] 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


================
@@ -224,6 +224,12 @@ New checks
   Recommends the smallest possible underlying type for an ``enum`` or ``enum``
   class based on the range of its enumerators.
 
+- New :doc:`readability-use-std-min-max
+  <clang-tidy/checks/readability/use-std-min-max>` check.
+
+  Replaces certain conditional statements with equivalent ``std::min`` or
+  ``std::max`` expressions.
+
----------------
5chmidti wrote:

Please move this after the other newly added `readability` checks so that the list is sorted alphabetically.

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


More information about the cfe-commits mailing list