brintos

brintos / llvm-project-archived public Read only

0
0
Text · 929 B · 903e791 Raw
42 lines · plain
1.. title:: clang-tidy - modernize-use-integer-sign-comparison2 3modernize-use-integer-sign-comparison4=====================================5 6Replace comparisons between signed and unsigned integers with their safe7C++20 ``std::cmp_*`` alternative, if available.8 9The check provides a replacement only for C++20 or later, otherwise10it highlights the problem and expects the user to fix it manually.11 12Examples of fixes created by the check:13 14.. code-block:: c++15 16  unsigned int func(int a, unsigned int b) {17    return a == b;18  }19 20becomes21 22.. code-block:: c++23 24  #include <utility>25 26  unsigned int func(int a, unsigned int b) {27    return std::cmp_equal(a, b);28  }29 30Options31-------32 33.. option:: IncludeStyle34 35  A string specifying which include-style is used, `llvm` or `google`.36  Default is `llvm`.37 38.. option:: EnableQtSupport39 40  Makes C++17 ``q20::cmp_*`` alternative available for Qt-based41  applications. Default is `false`.42