[libcxx-commits] [libcxx] [libc++] [test] Fix portability issues for MSVC (PR #93259)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 28 12:25:47 PDT 2024
================
@@ -67,12 +68,14 @@ T basic_gcd(T m, T n) {
template <typename Input>
void do_fuzzy_tests() {
std::mt19937 gen(1938);
- std::uniform_int_distribution<Input> distrib;
+ using DistIntType = std::conditional_t<sizeof(Input) == 1, int, Input>; // See N4981 [rand.req.genl]/1.5
+ constexpr Input max_input = std::numeric_limits<Input>::max();
+ std::uniform_int_distribution<DistIntType> distrib(0, max_input);
----------------
ldionne wrote:
Sorry @cjdb , I merged before you had time to comment. This wasn't intentional.
https://github.com/llvm/llvm-project/pull/93259
More information about the libcxx-commits
mailing list