[libcxx-commits] [PATCH] D102328: [libc++] Fix __bitop_unsigned_integer, rename to __is_unsigned_integer, and fix constexprness of std::countr_zero(__uint128_t)

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 17 10:05:06 PDT 2021


Mordante accepted this revision as: Mordante.
Mordante added a comment.

LGTM, with a few suggestions.



================
Comment at: libcxx/include/type_traits:816
+#ifndef _LIBCPP_HAS_NO_INT128
+template <> struct __is_unsigned_integer<__uint128_t>        : public true_type {};
+#endif
----------------
How do you feel about using `__libcpp_is_signed_integer` to match the `__libcpp_is_floating_point` below?


================
Comment at: libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp:60
+#ifndef _LIBCPP_HAS_NO_INT128
+constexpr bool test_uint128()
 {
----------------
What about removing this function and add it to the generic test and use it in a `if constexpr(std::same_as<T, __uint128_t>)` block?
(Obviously still guarded by`#ifndef _LIBCPP_HAS_NO_INT128`)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102328



More information about the libcxx-commits mailing list