[libc-commits] [libc] [libc] Add bigint casting between word types (PR #111914)

via libc-commits libc-commits at lists.llvm.org
Fri Oct 11 20:38:29 PDT 2024


================
@@ -927,4 +928,143 @@ TEST(LlvmLibcUIntClassTest, OtherWordTypeTests) {
   ASSERT_EQ(static_cast<int>(a >> 64), 1);
 }
 
+TEST(LlvmLibcUIntClassTest, OtherWordTypeCastTests) {
----------------
lntue wrote:

Then we should have `static_assert` to prevent / detect if it happens in the future.  Otherwise, it might occur with some template parameter computations, and we don't have anything to guarantee its behavior in that case.  Just like I was surprised when seeing that `UInt<10k+>` was actually used at some point.

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


More information about the libc-commits mailing list