diff --git a/stl/inc/xutility b/stl/inc/xutility index 2179e1251fd..56ffd264431 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -22,10 +22,16 @@ _STL_DISABLE_CLANG_WARNINGS #undef new #if (defined(_M_IX86) || defined(_M_X64)) && !defined(_M_CEE_PURE) && !defined(_M_HYBRID) && !defined(_M_ARM64EC) +#ifndef _USE_STD_VECTOR_ALGORITHMS #define _USE_STD_VECTOR_ALGORITHMS 1 -#else +#endif // _USE_STD_VECTOR_ALGORITHMS +#else // ^^^ arch supports vector algorithms / no support for vector algorithms vvv +#ifndef _USE_STD_VECTOR_ALGORITHMS #define _USE_STD_VECTOR_ALGORITHMS 0 -#endif +#elif _USE_STD_VECTOR_ALGORITHMS +#error Vector algorithms are not supported on this architecture, but _USE_STD_VECTOR_ALGORITHMS is set. +#endif // _USE_STD_VECTOR_ALGORITHMS +#endif // ^^^ no support for vector algorithms ^^^ #ifdef __CUDACC__ #define _CONSTEXPR_BIT_CAST inline diff --git a/tests/std/tests/VSO_0000000_vector_algorithms/env.lst b/tests/std/tests/VSO_0000000_vector_algorithms/env.lst index 19f025bd0e6..2e61ef96b9c 100644 --- a/tests/std/tests/VSO_0000000_vector_algorithms/env.lst +++ b/tests/std/tests/VSO_0000000_vector_algorithms/env.lst @@ -2,3 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception RUNALL_INCLUDE ..\usual_matrix.lst +RUNALL_CROSSLIST +PM_CL="" # Test default setting +PM_CL="/D_USE_STD_VECTOR_ALGORITHMS=0" # Test escape hatch, see GH-1751