1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // is_trivially_copy_constructible
13 #include <type_traits>
14 #include "test_macros.h"
17 void test_is_trivially_copy_constructible()
19 static_assert( std::is_trivially_copy_constructible
<T
>::value
, "");
20 static_assert( std::is_trivially_copy_constructible
<const T
>::value
, "");
22 static_assert( std::is_trivially_copy_constructible_v
<T
>, "");
23 static_assert( std::is_trivially_copy_constructible_v
<const T
>, "");
28 void test_has_not_trivial_copy_constructor()
30 static_assert(!std::is_trivially_copy_constructible
<T
>::value
, "");
31 static_assert(!std::is_trivially_copy_constructible
<const T
>::value
, "");
33 static_assert(!std::is_trivially_copy_constructible_v
<T
>, "");
34 static_assert(!std::is_trivially_copy_constructible_v
<const T
>, "");
58 virtual ~Abstract() = 0;
68 test_has_not_trivial_copy_constructor
<void>();
69 test_has_not_trivial_copy_constructor
<A
>();
70 test_has_not_trivial_copy_constructor
<Abstract
>();
71 test_has_not_trivial_copy_constructor
<NotEmpty
>();
73 test_is_trivially_copy_constructible
<int&>();
74 test_is_trivially_copy_constructible
<Union
>();
75 test_is_trivially_copy_constructible
<Empty
>();
76 test_is_trivially_copy_constructible
<int>();
77 test_is_trivially_copy_constructible
<double>();
78 test_is_trivially_copy_constructible
<int*>();
79 test_is_trivially_copy_constructible
<const int*>();
80 test_is_trivially_copy_constructible
<bit_zero
>();