================
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - modernize-use-integer-sign-comparison
+
+modernize-use-integer-sign-comparison
+=====================================
+
+Replace comparisons between signed and unsigned integers with their safe
+C++20 ``std::cmp_*`` alternative, if available.
+
+The check provides a replacement only for C++20 or later, otherwise
+it highlights the problem and expects a user fixes it manually.
+
+Examples of fixes created by the check:
+
+.. code-block:: c++
+
+  uint func(int a, uint b) {
+    return a == b;
+  }
+
+becomes
+
+.. code-block:: c++
+
+  #include <utility>
+
+  uint func(int a, uint b) {
+    return (std::cmp_equal(a, b));
----------------
5chmidti wrote:

Please remove the outer parentheses around the `cmp_equal`, as they are not 
added by the check

https://github.com/llvm/llvm-project/pull/113144
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to