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_move_constructible
13 #include <type_traits>
14 #include "test_macros.h"
17 void test_is_trivially_move_constructible()
19 static_assert( std::is_trivially_move_constructible
<T
>::value
, "");
21 static_assert( std::is_trivially_move_constructible_v
<T
>, "");
26 void test_has_not_trivial_move_constructor()
28 static_assert(!std::is_trivially_move_constructible
<T
>::value
, "");
30 static_assert(!std::is_trivially_move_constructible_v
<T
>, "");
54 virtual ~Abstract() = 0;
62 #if TEST_STD_VER >= 11
66 MoveOnly1(MoveOnly1
&&);
71 MoveOnly2(MoveOnly2
&&) = default;
78 test_has_not_trivial_move_constructor
<void>();
79 test_has_not_trivial_move_constructor
<A
>();
80 test_has_not_trivial_move_constructor
<Abstract
>();
81 test_has_not_trivial_move_constructor
<NotEmpty
>();
83 test_is_trivially_move_constructible
<Union
>();
84 test_is_trivially_move_constructible
<Empty
>();
85 test_is_trivially_move_constructible
<int>();
86 test_is_trivially_move_constructible
<double>();
87 test_is_trivially_move_constructible
<int*>();
88 test_is_trivially_move_constructible
<const int*>();
89 test_is_trivially_move_constructible
<bit_zero
>();
91 #if TEST_STD_VER >= 11
92 static_assert(!std::is_trivially_move_constructible
<MoveOnly1
>::value
, "");
93 static_assert( std::is_trivially_move_constructible
<MoveOnly2
>::value
, "");