[libcxx-commits] [libcxx] [libc++] Make views::iota aware of __int128 (PR #167869)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 17 07:56:43 PST 2025


================
@@ -58,11 +58,17 @@ struct __get_wider_signed {
       return type_identity<int>{};
     else if constexpr (sizeof(_Int) < sizeof(long))
       return type_identity<long>{};
-    else
+    else if constexpr (sizeof(_Int) < sizeof(long long))
       return type_identity<long long>{};
-
-    static_assert(
-        sizeof(_Int) <= sizeof(long long), "Found integer-like type that is bigger than largest integer like type.");
+#  if _LIBCPP_HAS_INT128
+    else if constexpr (sizeof(_Int) <= sizeof(__int128))
+      return type_identity<__int128>{};
+#  else
+    else if constexpr (sizeof(_Int) <= sizeof(long long))
+      return type_identity<long long>{};
+#  endif
+    else
+      static_assert(false, "Found integer-like type that is bigger than largest integer like type.");
----------------
ldionne wrote:

```suggestion
      static_assert(false, "Found integer-like type that is bigger than the largest integer-like type.");
```

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


More information about the libcxx-commits mailing list