From 5a83710e371fe68a06e6e3876c6a2c8b820a8976 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 20 Dec 2014 01:40:03 +0000 Subject: Move test into test/std subdirectory. llvm-svn: 224658 --- .../arithmetic.operations/transparent.pass.cpp | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 libcxx/test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp (limited to 'libcxx/test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp') diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp new file mode 100644 index 00000000000..72b4b4a0a1f --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp @@ -0,0 +1,61 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#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