[all-commits] [llvm/llvm-project] e7dd22: [clang-tidy] Add new check `readability-use-numeri...

Katherine Whitlock via All-commits all-commits at lists.llvm.org
Sat Jun 21 11:10:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7dd223ec451d4e8e522aa4f2c2baaa3d027f347
      https://github.com/llvm/llvm-project/commit/e7dd223ec451d4e8e522aa4f2c2baaa3d027f347
  Author: Katherine Whitlock <kate at skylinesynths.nyc>
  Date:   2025-06-21 (Sat, 21 Jun 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/CMakeLists.txt
    M clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
    A clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp
    A clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst
    A clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp

  Log Message:
  -----------
  [clang-tidy] Add new check `readability-use-numeric-limits` (#127430)

The adds a check that replaces specific numeric literals like `32767`
with the equivalent call to `std::numeric_limits` (such as
`std::numeric_limits<int16_t>::max())`.

Partially addresses #34434, but notably does not handle cases listed in
the title post such as `~0` and `-1`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list