[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 16:53:53 PDT 2024


================
@@ -123,10 +123,16 @@ New checks
   Gives warnings for tagged unions, where the number of tags is
   different from the number of data members inside the union.
 
+- New :doc:`modernize-use-integer-sign-comparison
+  <clang-tidy/checks/modernize/use-integer-sign-comparison>` check.
+
+  Replace comparisons between signed and unsigned integers with their safe
+  ``std::cmp_*`` alternative.
----------------
5chmidti wrote:

Actually, please add 

> C++20 ``std::cmp_*`` alternative, if available.

Since the replacement is only available since C++20.

(+ synchronize with documentation and heaeder comment)

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


More information about the cfe-commits mailing list