[libcxx-commits] [libcxx] [libc++] Prevent ADL on make_index_sequence in to_array (PR #184716)
Fady Farag via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 4 17:00:28 PST 2026
https://github.com/iidmsa created https://github.com/llvm/llvm-project/pull/184716
Suppress ADL on make_index_sequence in both to_array overloads.
>From d3c0e19d14b387cf5daa1239e7c2d40084e714f7 Mon Sep 17 00:00:00 2001
From: Fady Farag <com.webkit.iidmsa at gmail.com>
Date: Wed, 4 Mar 2026 18:48:06 -0600
Subject: [PATCH] [libc++] Prevent ADL on make_index_sequence in to_array
Suppress ADL on make_index_sequence in both to_array overloads.
---
libcxx/include/array | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/array b/libcxx/include/array
index 0b0c85458999c..cece072ab9fe1 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -577,7 +577,7 @@ template <typename _Tp, size_t _Size>
to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
static_assert(!is_array_v<_Tp>, "[array.creation]/1: to_array does not accept multidimensional arrays.");
static_assert(is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements.");
- return std::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
+ return std::__to_array_lvalue_impl(__arr, std::make_index_sequence<_Size>());
}
template <typename _Tp, size_t _Size>
@@ -585,7 +585,7 @@ template <typename _Tp, size_t _Size>
to_array(_Tp (&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
static_assert(!is_array_v<_Tp>, "[array.creation]/4: to_array does not accept multidimensional arrays.");
static_assert(is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements.");
- return std::__to_array_rvalue_impl(std::move(__arr), make_index_sequence<_Size>());
+ return std::__to_array_rvalue_impl(std::move(__arr), std::make_index_sequence<_Size>());
}
# endif // _LIBCPP_STD_VER >= 20
More information about the libcxx-commits
mailing list