diff options
Diffstat (limited to 'libcxx/test/std/utilities/utility/forward/move.fail.cpp')
-rw-r--r-- | libcxx/test/std/utilities/utility/forward/move.fail.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/utility/forward/move.fail.cpp b/libcxx/test/std/utilities/utility/forward/move.fail.cpp new file mode 100644 index 00000000000..bd2126cbaee --- /dev/null +++ b/libcxx/test/std/utilities/utility/forward/move.fail.cpp @@ -0,0 +1,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 +} |