[libcxx-commits] [libcxx] [libc++] Prevent ADL on make_index_sequence in to_array (PR #184716)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 4 17:00:58 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Fady Farag (iidmsa)

<details>
<summary>Changes</summary>

Suppress ADL on make_index_sequence in both to_array overloads.

---
Full diff: https://github.com/llvm/llvm-project/pull/184716.diff


1 Files Affected:

- (modified) libcxx/include/array (+2-2) 


``````````diff
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

``````````

</details>


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


More information about the libcxx-commits mailing list