1c24e6dd3SEric Fiselier //===----------------------------------------------------------------------===// 2c24e6dd3SEric Fiselier // 357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6c24e6dd3SEric Fiselier // 7c24e6dd3SEric Fiselier //===----------------------------------------------------------------------===// 8c24e6dd3SEric Fiselier 9c24e6dd3SEric Fiselier // UNSUPPORTED: c++98, c++03 10c24e6dd3SEric Fiselier 11c24e6dd3SEric Fiselier // test move 12c24e6dd3SEric Fiselier 13c24e6dd3SEric Fiselier #include <utility> 14c24e6dd3SEric Fiselier #include <cassert> 15c24e6dd3SEric Fiselier 16c24e6dd3SEric Fiselier struct move_only { 17c24e6dd3SEric Fiselier move_only() {} 18c24e6dd3SEric Fiselier move_only(move_only&&) = default; 19c24e6dd3SEric Fiselier move_only& operator=(move_only&&) = default; 20c24e6dd3SEric Fiselier }; 21c24e6dd3SEric Fiselier 22c24e6dd3SEric Fiselier move_only source() {return move_only();} 23c24e6dd3SEric Fiselier const move_only csource() {return move_only();} 24c24e6dd3SEric Fiselier 25c24e6dd3SEric Fiselier void test(move_only) {} 26c24e6dd3SEric Fiselier 27*2df59c50SJF Bastien int main(int, char**) 28c24e6dd3SEric Fiselier { 29c24e6dd3SEric Fiselier move_only a; 30c24e6dd3SEric Fiselier const move_only ca = move_only(); 31c24e6dd3SEric Fiselier 32c24e6dd3SEric Fiselier test(std::move(ca)); // c 33*2df59c50SJF Bastien 34*2df59c50SJF Bastien return 0; 35c24e6dd3SEric Fiselier } 36