[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 14:55:22 PDT 2024


================
@@ -0,0 +1,50 @@
+.. title:: clang-tidy - modernize-min-max-use-initializer-list
+
+modernize-min-max-use-initializer-list
+======================================
+
+Replaces nested ``std::min`` and ``std::max`` calls with an initializer list 
+where applicable.
+
+For instance, consider the following code:
+
+.. code-block:: cpp
+
+   int a = std::max(std::max(i, j), k);
----------------
PiotrZSL wrote:

GENERIC: use 2 spaces instead of 3 for block indent

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


More information about the cfe-commits mailing list