diff options
Diffstat (limited to 'libcxx/test/std/utilities')
3 files changed, 38 insertions, 8 deletions
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp index 83fa452fecb..5d833e28830 100644 --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp @@ -14,12 +14,16 @@ // template<class T> struct is_bind_expression #include <functional> +#include "test_macros.h" template <bool Expected, class T> void test(const T&) { static_assert(std::is_bind_expression<T>::value == Expected, ""); +#if TEST_STD_VER > 14 + static_assert(std::is_bind_expression_v<T> == Expected, ""); +#endif } struct C {}; diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp index 6a52bd1848e..1d7c649dfc0 100644 --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp @@ -12,12 +12,16 @@ // struct is_placeholder #include <functional> +#include "test_macros.h" template <int Expected, class T> void test(const T&) { static_assert(std::is_placeholder<T>::value == Expected, ""); +#if TEST_STD_VER > 14 + static_assert(std::is_placeholder_v<T> == Expected, ""); +#endif } struct C {}; diff --git a/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp b/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp index bd32bc34e7a..919c56bc7d7 100644 --- a/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp +++ b/libcxx/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp @@ -38,16 +38,38 @@ private: typedef int allocator_type; }; +template <bool Expected, class T, class A> +void +test() +{ + static_assert(std::uses_allocator<T, A>::value == Expected, ""); +#if TEST_STD_VER > 14 + static_assert(std::uses_allocator_v<T, A> == Expected, ""); +#endif +} + int main() { - static_assert((!std::uses_allocator<int, std::allocator<int> >::value), ""); - static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), ""); - static_assert((!std::uses_allocator<A, std::allocator<int> >::value), ""); - static_assert((!std::uses_allocator<B, std::allocator<int> >::value), ""); - static_assert(( std::uses_allocator<B, double>::value), ""); - static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), ""); - static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), ""); + test<false, int, std::allocator<int> >(); + test<true, std::vector<int>, std::allocator<int> >(); + test<false, A, std::allocator<int> >(); + test<false, B, std::allocator<int> >(); + test<true, B, double>(); + test<false, C, decltype(C::allocator_type)>(); + test<false, D, decltype(D::allocator_type)>(); #if TEST_STD_VER >= 11 - static_assert((!std::uses_allocator<E, int>::value), ""); + test<false, E, int>(); #endif + + +// static_assert((!std::uses_allocator<int, std::allocator<int> >::value), ""); +// static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), ""); +// static_assert((!std::uses_allocator<A, std::allocator<int> >::value), ""); +// static_assert((!std::uses_allocator<B, std::allocator<int> >::value), ""); +// static_assert(( std::uses_allocator<B, double>::value), ""); +// static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), ""); +// static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), ""); +// #if TEST_STD_VER >= 11 +// static_assert((!std::uses_allocator<E, int>::value), ""); +// #endif } |