[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

Katherine Whitlock via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 08:04:49 PDT 2025


stellar-aria wrote:

I'm assuming the MSAN failure is a result of the ASAN failure, since I don't see any reference to UseNumericLimitsCheck in that output.

The ASAN output however...
```/home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp:69:64: runtime error: negation of -9223372036854775808 cannot be represented in type 'long'; cast to an unsigned type to negate this value to itself```

Looks like the `auto Value` in this matcher might be getting type inferred to `long` instead of `long long`?
https://github.com/llvm/llvm-project/blob/a50cb6ca3e125a2920d38c98d517393d1a5828d2/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp#L67-L72




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


More information about the cfe-commits mailing list