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

Erik Pilkington via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 13 10:44:39 PDT 2020


erik.pilkington added inline comments.


================
Comment at: libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp:153
+
+// For some reason, __builtin_memcmp of the floating point types doesn't appear
+// to work inside constexpr.
----------------
ldionne wrote:
> @erik.pilkington Any idea why those don't work inside constexpr?
Its hitting the isInt() check here: https://github.com/llvm/llvm-project/blob/master/clang/lib/AST/ExprConstant.cpp#L11102. Seems like constexpr __builtin_memcmp was only implemented for integers.


================
Comment at: libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp:196
+    };
+    for (long double d : long_doubles) {
+        test_nested_roundtrip(d);
----------------
ldionne wrote:
> @erik.pilkington All the tests for `long double` are failing (at runtime) -- any idea why? Did you implement support for long double in `__builtin_bit_cast`?
Eek, it looks like this is asserting at compile time too. Let me take a closer look.


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