This patch fixes the following compilation error:
/home/mgadelha/tools/llvm-project/libc/src/__support/CPP/bit.h:29:10: error: __builtin_bit_cast source type must be trivially copyable return __builtin_bit_cast(To, from); ^ /home/mgadelha/tools/llvm-project/libc/src/__support/FPUtil/FPBits.h:119:47: note: in instantiation of function template specialization '__llvm_libc::cpp::bit_cast<long double, __llvm_libc::cpp::UInt<128>>' requested here LIBC_INLINE T get_val() const { return cpp::bit_cast<T>(bits); }
This happen when building for a 32 bit target (in my case it was
riscv32) without int128 support, so we use UInt<128> instead, which
is not trivially copyable.
We cannot use the C++ standard library in the runtime components of the libc. Would marking the copy constructor with = default solve your problem: https://github.com/llvm/llvm-project/blob/main/libc/src/__support/UInt.h#L40