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 // <fstream>
13 
14 // template <class charT, class traits = char_traits<charT> >
15 // class basic_ifstream
16 
17 // basic_ifstream& operator=(basic_ifstream&& rhs);
18 
19 #include <fstream>
20 #include <cassert>
21 
main()22 int main()
23 {
24     {
25         std::ifstream fso("test.dat");
26         std::ifstream fs;
27         fs = move(fso);
28         double x = 0;
29         fs >> x;
30         assert(x == 3.25);
31     }
32     {
33         std::wifstream fso("test.dat");
34         std::wifstream fs;
35         fs = move(fso);
36         double x = 0;
37         fs >> x;
38         assert(x == 3.25);
39     }
40 }
41