diff --git a/libcxx/test/utilities/function.objects/arithmetic.operations/transparent.pass.cpp b/libcxx/test/utilities/function.objects/arithmetic.operations/transparent.pass.cpp new file mode 100644 index 000000000000..43e2e2120b27 --- /dev/null +++ b/libcxx/test/utilities/function.objects/arithmetic.operations/transparent.pass.cpp @@ -0,0 +1,52 @@ +#include +#include + +template +struct is_transparent +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::is_transparent* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + + +int main () { +#if _LIBCPP_STD_VER > 11 + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + +#endif + + return 0; + } diff --git a/libcxx/test/utilities/function.objects/bitwise.operations/transparent.pass.cpp b/libcxx/test/utilities/function.objects/bitwise.operations/transparent.pass.cpp new file mode 100644 index 000000000000..91d263ed03fc --- /dev/null +++ b/libcxx/test/utilities/function.objects/bitwise.operations/transparent.pass.cpp @@ -0,0 +1,42 @@ +#include +#include + +template +struct is_transparent +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::is_transparent* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + + +int main () { +#if _LIBCPP_STD_VER > 11 + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + +#endif + + return 0; + } diff --git a/libcxx/test/utilities/function.objects/comparisons/transparent.pass.cpp b/libcxx/test/utilities/function.objects/comparisons/transparent.pass.cpp new file mode 100644 index 000000000000..516b3644d712 --- /dev/null +++ b/libcxx/test/utilities/function.objects/comparisons/transparent.pass.cpp @@ -0,0 +1,52 @@ +#include +#include + +template +struct is_transparent +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::is_transparent* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + + +int main () { +#if _LIBCPP_STD_VER > 11 + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + +#endif + + return 0; + } diff --git a/libcxx/test/utilities/function.objects/logical.operations/transparent.pass.cpp b/libcxx/test/utilities/function.objects/logical.operations/transparent.pass.cpp new file mode 100644 index 000000000000..5b3e1877c218 --- /dev/null +++ b/libcxx/test/utilities/function.objects/logical.operations/transparent.pass.cpp @@ -0,0 +1,37 @@ +#include +#include + +template +struct is_transparent +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::is_transparent* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + + +int main () { +#if _LIBCPP_STD_VER > 11 + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + + static_assert ( !is_transparent>::value, "" ); + static_assert ( !is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + static_assert ( is_transparent>::value, "" ); + +#endif + + return 0; + }