xref: /aosp_15_r20/external/cronet/third_party/libc++/src/test/support/type_classification/moveconstructible.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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 #ifndef TEST_SUPPORT_TYPE_CLASSIFICATION_MOVECONSTRUCTIBLE_H
10 #define TEST_SUPPORT_TYPE_CLASSIFICATION_MOVECONSTRUCTIBLE_H
11 
12 struct HasDefaultOps {};
13 
14 struct CustomMoveCtor {
15   CustomMoveCtor(CustomMoveCtor&&) noexcept;
16 };
17 
18 struct MoveOnly {
19   MoveOnly(MoveOnly&&) noexcept = default;
20   MoveOnly& operator=(MoveOnly&&) noexcept = default;
21   MoveOnly(const MoveOnly&) = delete;
22   MoveOnly& operator=(const MoveOnly&) = default;
23 };
24 
25 struct CustomMoveAssign {
26   CustomMoveAssign(CustomMoveAssign&&) noexcept;
27   CustomMoveAssign& operator=(CustomMoveAssign&&) noexcept;
28 };
29 
30 struct DeletedMoveCtor {
31   DeletedMoveCtor(DeletedMoveCtor&&) = delete;
32   DeletedMoveCtor& operator=(DeletedMoveCtor&&) = default;
33 };
34 
35 struct ImplicitlyDeletedMoveCtor {
36   DeletedMoveCtor X;
37 };
38 
39 struct DeletedMoveAssign {
40   DeletedMoveAssign& operator=(DeletedMoveAssign&&) = delete;
41 };
42 
43 struct ImplicitlyDeletedMoveAssign {
44   DeletedMoveAssign X;
45 };
46 
47 class MemberLvalueReference {
48 public:
49   MemberLvalueReference(int&);
50 
51 private:
52   int& X;
53 };
54 
55 class MemberRvalueReference {
56 public:
57   MemberRvalueReference(int&&);
58 
59 private:
60   int&& X;
61 };
62 
63 struct NonMovable {
64   NonMovable() = default;
65   NonMovable(NonMovable&&) = delete;
66   NonMovable& operator=(NonMovable&&) = delete;
67 };
68 
69 struct DerivedFromNonMovable : NonMovable {};
70 
71 struct HasANonMovable {
72   NonMovable X;
73 };
74 
75 #endif // TEST_SUPPORT_TYPE_CLASSIFICATION_MOVECONSTRUCTIBLE_H
76