[libc++] Explicitly reject `uniform_int_distribution<bool>` and `<char>`.
`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 accidentally made `uniform_int_distribution<bool>`
into an error. Make it now *intentionally* an error; and likewise for the
character types and all user-defined class and enum types; but permit
`__[u]int128_t` to continue working.
Apply the same static_assert to all the integer distributions.
Differential Revision: https://reviews.llvm.org/D114920
NOKEYCHECK=True
GitOrigin-RevId: a3255f219a861fd91423def693e1b3ab3e012bec
diff --git a/include/module.modulemap b/include/module.modulemap
index ecfe080..294abd4 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -764,6 +764,7 @@
module geometric_distribution { private header "__random/geometric_distribution.h" }
module independent_bits_engine { private header "__random/independent_bits_engine.h" }
module is_seed_sequence { private header "__random/is_seed_sequence.h" }
+ module is_valid { private header "__random/is_valid.h" }
module knuth_b { private header "__random/knuth_b.h" }
module linear_congruential_engine { private header "__random/linear_congruential_engine.h" }
module log2 { private header "__random/log2.h" }