Index: test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp =================================================================== --- test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp +++ test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp @@ -89,6 +89,7 @@ CHECK_ALWAYS_LOCK_FREE(float); CHECK_ALWAYS_LOCK_FREE(double); CHECK_ALWAYS_LOCK_FREE(long double); +#if __has_attribute(vector_size) && defined(_LIBCPP_VERSION) CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(1 * sizeof(int))))); CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(2 * sizeof(int))))); CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(4 * sizeof(int))))); @@ -104,6 +105,7 @@ CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(4 * sizeof(double))))); CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(16 * sizeof(double))))); CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(32 * sizeof(double))))); +#endif // __has_attribute(vector_size) && defined(_LIBCPP_VERSION) CHECK_ALWAYS_LOCK_FREE(struct Empty {}); CHECK_ALWAYS_LOCK_FREE(struct OneInt { int i; }); CHECK_ALWAYS_LOCK_FREE(struct IntArr2 { int i[2]; }); Index: test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp =================================================================== --- test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp +++ test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp @@ -305,15 +305,17 @@ using RetT = decltype(std::not_fn(value)); static_assert(std::is_move_constructible::value, ""); static_assert(std::is_copy_constructible::value, ""); - static_assert(std::is_move_assignable::value, ""); - static_assert(std::is_copy_assignable::value, ""); + LIBCPP_STATIC_ASSERT(std::is_move_assignable::value, ""); + LIBCPP_STATIC_ASSERT(std::is_copy_assignable::value, ""); auto ret = std::not_fn(value); assert(ret() == false); auto ret2 = std::not_fn(value2); assert(ret2() == true); +#if defined(_LIBCPP_VERSION) ret = ret2; assert(ret() == true); assert(ret2() == true); +#endif // _LIBCPP_VERSION } { using T = MoveAssignableWrapper; @@ -322,14 +324,16 @@ using RetT = decltype(std::not_fn(std::move(value))); static_assert(std::is_move_constructible::value, ""); static_assert(!std::is_copy_constructible::value, ""); - static_assert(std::is_move_assignable::value, ""); + LIBCPP_STATIC_ASSERT(std::is_move_assignable::value, ""); static_assert(!std::is_copy_assignable::value, ""); auto ret = std::not_fn(std::move(value)); assert(ret() == false); auto ret2 = std::not_fn(std::move(value2)); assert(ret2() == true); +#if defined(_LIBCPP_VERSION) ret = std::move(ret2); assert(ret() == true); +#endif // _LIBCPP_VERSION } } @@ -426,7 +430,7 @@ { ThrowsOnCopy cp; try { - std::not_fn(cp); + (void)std::not_fn(cp); assert(false); } catch (int const& value) { assert(value == 42); Index: test/support/msvc_stdlib_force_include.hpp =================================================================== --- test/support/msvc_stdlib_force_include.hpp +++ test/support/msvc_stdlib_force_include.hpp @@ -52,6 +52,13 @@ #define _MSVC_HAS_FEATURE_memory_sanitizer 0 #define _MSVC_HAS_FEATURE_thread_sanitizer 0 + #define __has_attribute(X) _MSVC_HAS_ATTRIBUTE_ ## X + #define _MSVC_HAS_ATTRIBUTE_vector_size 0 + + #ifdef _NOEXCEPT_TYPES_SUPPORTED + #define __cpp_noexcept_function_type 201510 + #endif // _NOEXCEPT_TYPES_SUPPORTED + // Silence compiler warnings. #pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored #pragma warning(disable: 4324) // structure was padded due to alignment specifier @@ -85,4 +92,12 @@ #define TEST_STD_VER 14 #endif // _HAS_CXX17 +// Simulate library feature-test macros. +#define __cpp_lib_invoke 201411 +#define __cpp_lib_void_t 201411 + +#if _HAS_CXX17 + #define __cpp_lib_atomic_is_always_lock_free 201603 +#endif // _HAS_CXX17 + #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP