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 #include "test_macros.h"
22 
23 int main(int, char**)
24 {
25     {
26         std::ifstream fso("test.dat");
27         std::ifstream 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 = move(fso);
35         double x = 0;
36         fs >> x;
37         assert(x == 3.25);
38     }
39 
40   return 0;
41 }
42