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

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 14:32:30 PST 2024


================
@@ -224,6 +224,13 @@ 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, improving readability and promoting the use of
+  standard library functions.
----------------
PiotrZSL wrote:

"improving readability and promoting the use of  standard library functions." that part is not needed here.

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


More information about the cfe-commits mailing list