Home | History | Annotate | Download | only in forward
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // test move
     13 
     14 #include <utility>
     15 #include <cassert>
     16 
     17 struct move_only {
     18     move_only() {}
     19     move_only(move_only&&) = default;
     20     move_only& operator=(move_only&&) = default;
     21 };
     22 
     23 move_only source() {return move_only();}
     24 const move_only csource() {return move_only();}
     25 
     26 void test(move_only) {}
     27 
     28 int main()
     29 {
     30     move_only a;
     31     const move_only ca = move_only();
     32 
     33     test(std::move(ca)); // c
     34 }
     35