diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -4221,7 +4221,8 @@ >::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - _VSTD::swap_ranges(__a, __a + _Np, __b); + for (size_t __i = 0; __i != _Np; ++__i) + swap(__a[__i], __b[__i]); } template diff --git a/libcxx/test/std/utilities/utility/utility.swap/swap_array.pass.cpp b/libcxx/test/std/utilities/utility/utility.swap/swap_array.pass.cpp --- a/libcxx/test/std/utilities/utility/utility.swap/swap_array.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.swap/swap_array.pass.cpp @@ -13,9 +13,9 @@ // void // swap(T (&a)[N], T (&b)[N]); -#include #include #include +#include #include "test_macros.h"