1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++98, c++03
10 
11 // <fstream>
12 
13 // template <class charT, class traits = char_traits<charT> >
14 // class basic_ifstream
15 
16 // basic_ifstream(basic_ifstream&& rhs);
17 
18 #include <fstream>
19 #include <cassert>
20 
21 int main(int, char**)
22 {
23     {
24         std::ifstream fso("test.dat");
25         std::ifstream fs = move(fso);
26         double x = 0;
27         fs >> x;
28         assert(x == 3.25);
29     }
30     {
31         std::wifstream fso("test.dat");
32         std::wifstream fs = move(fso);
33         double x = 0;
34         fs >> x;
35         assert(x == 3.25);
36     }
37 
38   return 0;
39 }
40