[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


================
@@ -136,6 +142,16 @@ New check aliases
   :doc:`bugprone-sizeof-expression
   <clang-tidy/checks/bugprone/sizeof-expression>` was added.
 
+- New alias :doc:`qt-integer-sign-comparison
+  <clang-tidy/checks/qt/integer-sign-comparison>` to
+  :doc:`modernize-use-integer-sign-comparison
+  <clang-tidy/checks/modernize/use-integer-sign-comparison>` check.
+  If C++17 is supported, the fix-it replaces integers comparisons to
+  ``q20::cmp_equal``, ``q20::cmp_not_equal``, ``q20::cmp_less``,
+  ``q20::cmp_greater``, ``q20::cmp_less_equal`` and ``q20::cmp_greater_equal``
+  functions.
+  The check assumes the analysed code is Qt-based code.
----------------
5chmidti wrote:

Maybe mirror the description with that the `modernize` check has? Either way, the `The check assumes...` sentence can be deleted. It's implied from the check category

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


More information about the cfe-commits mailing list