From 75f9aa9993acc7e611cde614fdb71c8c2d5bbdaa Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 13 Aug 2013 01:12:41 +0000 Subject: More support for N3657; tests for is_transparent llvm-svn: 188242 --- .../arithmetic.operations/transparent.pass.cpp | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 libcxx/test/utilities/function.objects/arithmetic.operations/transparent.pass.cpp (limited to 'libcxx/test/utilities/function.objects/arithmetic.operations') 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 00000000000..43e2e2120b2 --- /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; + } -- cgit v1.2.3