You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/utilities/utility/forward/move.fail.cpp

35 lines
785 B
C++

//===----------------------------------------------------------------------===//
//
// 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
}