blob: db67f63af78ea218712af7e8e4f261659543eba4 [file] [log] [blame]
Marshall Clow354d39c2014-01-16 16:58:45 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Asiri Rathnayake6edc12c2016-05-28 08:57:35 +000010// UNSUPPORTED: c++98, c++03, c++11
Marshall Clow75f9aa92013-08-13 01:12:41 +000011#include <functional>
12#include <string>
13
14template <class _Tp>
15struct is_transparent
16{
17private:
18 struct __two {char __lx; char __lxx;};
19 template <class _Up> static __two __test(...);
20 template <class _Up> static char __test(typename _Up::is_transparent* = 0);
21public:
22 static const bool value = sizeof(__test<_Tp>(0)) == 1;
23};
24
25
26int main () {
Marshall Clow75f9aa92013-08-13 01:12:41 +000027 static_assert ( !is_transparent<std::bit_and<int>>::value, "" );
28 static_assert ( !is_transparent<std::bit_and<std::string>>::value, "" );
29 static_assert ( is_transparent<std::bit_and<void>>::value, "" );
30 static_assert ( is_transparent<std::bit_and<>>::value, "" );
31
32 static_assert ( !is_transparent<std::bit_or<int>>::value, "" );
33 static_assert ( !is_transparent<std::bit_or<std::string>>::value, "" );
34 static_assert ( is_transparent<std::bit_or<void>>::value, "" );
35 static_assert ( is_transparent<std::bit_or<>>::value, "" );
36
37 static_assert ( !is_transparent<std::bit_xor<int>>::value, "" );
38 static_assert ( !is_transparent<std::bit_xor<std::string>>::value, "" );
39 static_assert ( is_transparent<std::bit_xor<void>>::value, "" );
40 static_assert ( is_transparent<std::bit_xor<>>::value, "" );
41
42 static_assert ( !is_transparent<std::bit_not<int>>::value, "" );
43 static_assert ( !is_transparent<std::bit_not<std::string>>::value, "" );
44 static_assert ( is_transparent<std::bit_not<void>>::value, "" );
45 static_assert ( is_transparent<std::bit_not<>>::value, "" );
46
Marshall Clow75f9aa92013-08-13 01:12:41 +000047 return 0;
Asiri Rathnayake6edc12c2016-05-28 08:57:35 +000048}