[libcxx-commits] [PATCH] D114920: [libc++] Re-enable `uniform_int_distribution<bool>`.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 1 17:01:29 PST 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: fwolff, ldionne, var-const, Mordante, mclow.lists, libc++, leonardchan.
Quuxplusone added a project: libc++.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

`uniform_int_distribution<T>` is UB unless `T` is one of the non-character,
non-boolean integer types (`short` or larger). However, libc++ has never
enforced this. D114129 <https://reviews.llvm.org/D114129> accidentally made `uniform_int_distribution<bool>`
into an error. Make it work again; but also, add new statistical tests
for all supported `T`s, including `bool` and `char`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114920

Files:
  libcxx/include/__random/uniform_int_distribution.h
  libcxx/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114920.391171.patch
Type: text/x-patch
Size: 21796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211202/902930ed/attachment-0001.bin>


More information about the libcxx-commits mailing list