[libc-commits] [libc] [libc] Make BigInt trivially constructible (PR #206277)
Krishna Pandey via libc-commits
libc-commits at lists.llvm.org
Thu Jul 2 08:55:19 PDT 2026
================
@@ -1184,30 +1187,30 @@ LIBC_INLINE_VAR constexpr bool is_unsigned_integral_or_big_int_v =
namespace cpp {
-// Specialization of cpp::bit_cast ('bit.h') from T to BigInt.
-template <typename To, typename From>
-LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR cpp::enable_if_t<
- (sizeof(To) == sizeof(From)) && cpp::is_trivially_copyable<To>::value &&
- cpp::is_trivially_copyable<From>::value && is_big_int<To>::value,
- To>
-bit_cast(const From &from) {
- To out;
- using Storage = decltype(out.val);
- out.val = cpp::bit_cast<Storage>(from);
- return out;
-}
-
-// Specialization of cpp::bit_cast ('bit.h') from BigInt to T.
-template <typename To, size_t Bits>
-LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR
- cpp::enable_if_t<sizeof(To) == sizeof(UInt<Bits>) &&
- cpp::is_trivially_constructible<To>::value &&
- cpp::is_trivially_copyable<To>::value &&
- cpp::is_trivially_copyable<UInt<Bits>>::value,
- To>
- bit_cast(const UInt<Bits> &from) {
- return cpp::bit_cast<To>(from.val);
-}
+// // Specialization of cpp::bit_cast ('bit.h') from T to BigInt.
+// template <typename To, typename From>
+// LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR cpp::enable_if_t<
+// (sizeof(To) == sizeof(From)) && cpp::is_trivially_copyable<To>::value &&
+// cpp::is_trivially_copyable<From>::value && is_big_int<To>::value,
+// To>
+// bit_cast(const From &from) {
+// To out;
+// using Storage = decltype(out.val);
+// out.val = cpp::bit_cast<Storage>(from);
+// return out;
+// }
+
+// // Specialization of cpp::bit_cast ('bit.h') from BigInt to T.
+// template <typename To, size_t Bits>
+// LIBC_INLINE LIBC_BIT_CAST_CONSTEXPR
+// cpp::enable_if_t<sizeof(To) == sizeof(UInt<Bits>) &&
+// cpp::is_trivially_constructible<To>::value &&
+// cpp::is_trivially_copyable<To>::value &&
+// cpp::is_trivially_copyable<UInt<Bits>>::value,
+// To>
+// bit_cast(const UInt<Bits> &from) {
+// return cpp::bit_cast<To>(from.val);
+// }
----------------
krishna2803 wrote:
```suggestion
```
this should be removed before merging
https://github.com/llvm/llvm-project/pull/206277
More information about the libc-commits
mailing list