[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:39 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:

The `Port` is not trivially constructable because it uses a reference instead of a pointer.

https://github.com/llvm/llvm-project/pull/71432


More information about the libc-commits mailing list