[libc-commits] [libc] [libc] Export the RPC interface from `libc` (PR #71432)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Tue Mar 19 06:40:19 PDT 2024
================
@@ -25,12 +25,14 @@ namespace LIBC_NAMESPACE::cpp {
#define LLVM_LIBC_HAS_BUILTIN_MEMCPY_INLINE
#endif
-// This implementation of bit_cast requires trivially-constructible To, to avoid
-// UB in the implementation.
template <typename To, typename From>
LIBC_INLINE constexpr cpp::enable_if_t<
(sizeof(To) == sizeof(From)) &&
+// Implementation of bit_cast that cannot use the compiler builtin must be
+// trivially-constructible To, to avoid UB in the implementation.
+#if !LIBC_HAS_BUILTIN(__builtin_bit_cast)
----------------
jhuber6 wrote:
I didn't write this code, but it's likely going off of what the documentation says https://en.cppreference.com/w/cpp/numeric/bit_cast.
https://github.com/llvm/llvm-project/pull/71432
More information about the libc-commits
mailing list