1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 #include <type_traits>
17 void test_is_destructible()
19 static_assert( std::is_destructible<T>::value, "");
20 static_assert( std::is_destructible<const T>::value, "");
21 static_assert( std::is_destructible<volatile T>::value, "");
22 static_assert( std::is_destructible<const volatile T>::value, "");
26 void test_is_not_destructible()
28 static_assert(!std::is_destructible<T>::value, "");
29 static_assert(!std::is_destructible<const T>::value, "");
30 static_assert(!std::is_destructible<volatile T>::value, "");
31 static_assert(!std::is_destructible<const volatile T>::value, "");
52 virtual ~Abstract() = 0;
60 typedef void (Function) ();
64 test_is_destructible<A>();
65 test_is_destructible<int&>();
66 test_is_destructible<Union>();
67 test_is_destructible<Empty>();
68 test_is_destructible<int>();
69 test_is_destructible<double>();
70 test_is_destructible<int*>();
71 test_is_destructible<const int*>();
72 test_is_destructible<char[3]>();
73 test_is_destructible<bit_zero>();
74 test_is_destructible<int[3]>();
76 test_is_not_destructible<int[]>();
77 test_is_not_destructible<void>();
78 test_is_not_destructible<Abstract>();
79 #if __has_feature(cxx_access_control_sfinae)
80 test_is_not_destructible<NotEmpty>();
82 test_is_not_destructible<Function>();