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

source code of libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp