summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/utility/forward/move.fail.cpp
blob: bd2126cbaee420fc0d1d69e9433bbd2fb97cfa9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03

// test move

#include <utility>
#include <cassert>

struct move_only {
    move_only() {}
    move_only(move_only&&) = default;
    move_only& operator=(move_only&&) = default;
};

move_only source() {return move_only();}
const move_only csource() {return move_only();}

void test(move_only) {}

int main()
{
    move_only a;
    const move_only ca = move_only();

    test(std::move(ca)); // c
}
OpenPOWER on IntegriCloud