[libcxx-commits] [PATCH] D75960: [libc++] Implement C++20's P0476r2: std::bit_cast

JF Bastien via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 8 16:54:06 PDT 2021


jfb added inline comments.


================
Comment at: libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp:253
+int main(int, char**) {
+    tests();
+    static_assert(basic_constexpr_test());
----------------
Quuxplusone wrote:
> I guess I meant to try to constexpr-ify `tests()` but never succeeded. The problems were (I think) with `std::nanl` and `std::memcmp`. I think it would be fine to ship this with only the `basic_constexpr_test`; although you might also try putting the `memcmp`s under `if (!std::is_constant_evaluated())` and splitting out the floating-point `nan` tests into a non-constexpr special test.
`nan` will be `constexpr` if you do `bool my_is_nan(double value) { return value != value; }`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75960



More information about the libcxx-commits mailing list