[libcxx-commits] [PATCH] D131999: [libcxx] Resolve warnings for Wshift-sign-overflow
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 17 08:43:32 PDT 2022
Mordante added inline comments.
================
Comment at: libcxx/include/__chrono/duration.h:215
static const intmax_t __d2 = _R2::den / __gcd_d1_d2;
- static const intmax_t max = -((intmax_t(1) << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1);
+ static const intmax_t max = numeric_limits<intmax_t>::max();
----------------
philnik wrote:
> That's a very complex way to write `numeric_limits<intmax_t>::max()`.
This is a private field is there a reason not to use an __ugly name?
@philnik shouldn't clang-tidy have spotted this?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131999/new/
https://reviews.llvm.org/D131999
More information about the libcxx-commits
mailing list