1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: libcpp-no-concepts
11 
12 // template<class T>
13 // concept move_constructible;
14 
15 #include <concepts>
16 #include <type_traits>
17 
18 #include "type_classification/moveconstructible.h"
19 
20 static_assert(std::move_constructible<int>);
21 static_assert(std::move_constructible<int*>);
22 static_assert(std::move_constructible<int&>);
23 static_assert(std::move_constructible<int&&>);
24 static_assert(std::move_constructible<const int>);
25 static_assert(std::move_constructible<const int&>);
26 static_assert(std::move_constructible<const int&&>);
27 static_assert(std::move_constructible<volatile int>);
28 static_assert(std::move_constructible<volatile int&>);
29 static_assert(std::move_constructible<volatile int&&>);
30 static_assert(std::move_constructible<int (*)()>);
31 static_assert(std::move_constructible<int (&)()>);
32 static_assert(std::move_constructible<HasDefaultOps>);
33 static_assert(std::move_constructible<CustomMoveCtor>);
34 static_assert(std::move_constructible<MoveOnly>);
35 static_assert(std::move_constructible<const CustomMoveCtor&>);
36 static_assert(std::move_constructible<volatile CustomMoveCtor&>);
37 static_assert(std::move_constructible<const CustomMoveCtor&&>);
38 static_assert(std::move_constructible<volatile CustomMoveCtor&&>);
39 static_assert(std::move_constructible<CustomMoveAssign>);
40 static_assert(std::move_constructible<const CustomMoveAssign&>);
41 static_assert(std::move_constructible<volatile CustomMoveAssign&>);
42 static_assert(std::move_constructible<const CustomMoveAssign&&>);
43 static_assert(std::move_constructible<volatile CustomMoveAssign&&>);
44 static_assert(std::move_constructible<int HasDefaultOps::*>);
45 static_assert(std::move_constructible<void (HasDefaultOps::*)(int)>);
46 static_assert(std::move_constructible<MemberLvalueReference>);
47 static_assert(std::move_constructible<MemberRvalueReference>);
48 
49 static_assert(!std::move_constructible<void>);
50 static_assert(!std::move_constructible<const CustomMoveCtor>);
51 static_assert(!std::move_constructible<volatile CustomMoveCtor>);
52 static_assert(!std::move_constructible<const CustomMoveAssign>);
53 static_assert(!std::move_constructible<volatile CustomMoveAssign>);
54 static_assert(!std::move_constructible<int[10]>);
55 static_assert(!std::move_constructible<DeletedMoveCtor>);
56 static_assert(!std::move_constructible<ImplicitlyDeletedMoveCtor>);
57 static_assert(!std::move_constructible<DeletedMoveAssign>);
58 static_assert(!std::move_constructible<ImplicitlyDeletedMoveAssign>);
59 
60 static_assert(std::move_constructible<DeletedMoveCtor&>);
61 static_assert(std::move_constructible<DeletedMoveCtor&&>);
62 static_assert(std::move_constructible<const DeletedMoveCtor&>);
63 static_assert(std::move_constructible<const DeletedMoveCtor&&>);
64 static_assert(std::move_constructible<ImplicitlyDeletedMoveCtor&>);
65 static_assert(std::move_constructible<ImplicitlyDeletedMoveCtor&&>);
66 static_assert(std::move_constructible<const ImplicitlyDeletedMoveCtor&>);
67 static_assert(std::move_constructible<const ImplicitlyDeletedMoveCtor&&>);
68 static_assert(std::move_constructible<DeletedMoveAssign&>);
69 static_assert(std::move_constructible<DeletedMoveAssign&&>);
70 static_assert(std::move_constructible<const DeletedMoveAssign&>);
71 static_assert(std::move_constructible<const DeletedMoveAssign&&>);
72 static_assert(std::move_constructible<ImplicitlyDeletedMoveAssign&>);
73 static_assert(std::move_constructible<ImplicitlyDeletedMoveAssign&&>);
74 static_assert(std::move_constructible<const ImplicitlyDeletedMoveAssign&>);
75 static_assert(std::move_constructible<const ImplicitlyDeletedMoveAssign&&>);
76 
77 static_assert(!std::move_constructible<NonMovable>);
78 static_assert(!std::move_constructible<DerivedFromNonMovable>);
79 static_assert(!std::move_constructible<HasANonMovable>);
80 
81 int main(int, char**) { return 0; }
82