| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
#include <type_traits> |
| 3 |
#include <testsuite_tr1.h> |
| 4 |
|
| 5 |
template<typename T> |
| 6 |
constexpr void test_cv() |
| 7 |
{ |
| 8 |
static_assert(std::is_trivially_destructible_v<const T> |
| 9 |
== std::is_trivially_destructible_v<T>); |
| 10 |
static_assert(std::is_trivially_destructible_v<volatile T> |
| 11 |
== std::is_trivially_destructible_v<T>); |
| 12 |
static_assert(std::is_trivially_destructible_v<const volatile T> |
| 13 |
== std::is_trivially_destructible_v<T>); |
| 14 |
} |
| 15 |
|
| 16 |
template<typename T, bool Expected> |
| 17 |
void test() |
| 18 |
{ |
| 19 |
static_assert(std::is_trivially_destructible_v<T> == Expected); |
| 20 |
test_cv<T>(); |
| 21 |
} |
| 22 |
|
| 23 |
void test01() |
| 24 |
{ |
| 25 |
using namespace __gnu_test; |
| 26 |
|
| 27 |
test<int, true>(); |
| 28 |
test<int&, true>(); |
| 29 |
test<int&&, true>(); |
| 30 |
test<int[1], true>(); |
| 31 |
test<TType, true>(); |
| 32 |
test<TType[1], true>(); |
| 33 |
test<PODType, true>(); |
| 34 |
test<PODType[1], true>(); |
| 35 |
test<NType, false>(); |
| 36 |
test<SLType, false>(); |
| 37 |
test<int(), false>(); |
| 38 |
test<void, false>(); |
| 39 |
test<int[], false>(); |
| 40 |
} |