[llvm] [ADT] [NFC] Resolve a potential overload ambiguity in the ADT unit tests (PR #85341)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 18:58:22 PDT 2024
================
@@ -2918,7 +2918,7 @@ TEST(APIntTest, Average) {
APInt A100(32, 100);
APInt A101(32, 101);
APInt A200(32, 200, false);
- APInt ApUMax(32, UINT_MAX, false);
+ APInt ApUMax(32, static_cast<uint64_t>(UINT_MAX), false);
----------------
kuhar wrote:
How about?
```suggestion
APInt ApUMax(32, static_cast<uint64_t>(std::numeric_limits<uint32_t>()), false);
```
or
```suggestion
APInt ApUMax(32, (~(uint64_t(0)) >> 32, false);
```
to avoid a system-specific definition of uint?
https://github.com/llvm/llvm-project/pull/85341
More information about the llvm-commits
mailing list