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 // 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& operator=(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;
29         fs = move(fso);
30         double x = 0;
31         fs >> x;
32         assert(x == 3.25);
33     }
34     {
35         std::wifstream fso("test.dat");
36         std::wifstream fs;
37         fs = move(fso);
38         double x = 0;
39         fs >> x;
40         assert(x == 3.25);
41     }
42 
43   return 0;
44 }
45