[libcxx-commits] [PATCH] D114129: [libc++] Fix `uniform_int_distribution` for 128-bit result type

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 28 04:40:40 PST 2021


Mordante accepted this revision.
Mordante added a comment.
This revision is now accepted and ready to land.

LGTM modulo one style issue. Please resolve this issue and rebase the patch to verify the CI is green before landing.



================
Comment at: libcxx/include/__random/log2.h:23
+template <class _UIntType, _UIntType _Xp, size_t _Rp>
+struct __log2_imp;
+
----------------
fwolff wrote:
> Mordante wrote:
> > Does this header the same as `__bit_log2` in `<bit>`?
> Yes, but `__bit_log2` is marked with `_LIBCPP_CONSTEXPR_AFTER_CXX11`, so it won't work for C++11 because we are using it to initialize `static const` members, or am I missing something?
Good point, too bad we can't remove the duplication.


================
Comment at: libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/int128.pass.cpp:29
+  {
+    auto e = std::minstd_rand0{};
+    auto d = std::uniform_int_distribution<__int128_t>{};
----------------
Please change `auto` with the type, here and in the remainder of this file. This is the typical style in LLVM/libc++.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114129/new/

https://reviews.llvm.org/D114129



More information about the libcxx-commits mailing list