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++98, c++03
10 
11 // test move
12 
13 #include <utility>
14 #include <cassert>
15 
16 struct move_only {
17     move_only() {}
18     move_only(move_only&&) = default;
19     move_only& operator=(move_only&&) = default;
20 };
21 
22 move_only source() {return move_only();}
23 const move_only csource() {return move_only();}
24 
25 void test(move_only) {}
26 
27 int main(int, char**)
28 {
29     move_only a;
30     const move_only ca = move_only();
31 
32     test(std::move(ca)); // c
33 
34   return 0;
35 }
36