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