[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>{};
----------------
ldionne wrote:

Pedantically, this is an ABI break if something depends on the difference-type of `iota_view`. I think this is tiny enough that we can ship it without really worrying. But I would still document this in the release notes.

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


More information about the libcxx-commits mailing list