]>
Commit | Line | Data |
---|---|---|
fbd26352 | 1 | // Copyright (C) 2018-2019 Free Software Foundation, Inc. |
d4fd5c49 | 2 | // |
3 | // This file is part of the GNU ISO C++ Library. This library is free | |
4 | // software; you can redistribute it and/or modify it under the | |
5 | // terms of the GNU General Public License as published by the | |
6 | // Free Software Foundation; either version 3, or (at your option) | |
7 | // any later version. | |
8 | ||
9 | // This library is distributed in the hope that it will be useful, | |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | // GNU General Public License for more details. | |
13 | ||
14 | // You should have received a copy of the GNU General Public License along | |
15 | // with this library; see the file COPYING3. If not see | |
16 | // <http://www.gnu.org/licenses/>. | |
17 | ||
18 | // { dg-do run { target *-*-mingw* } } | |
9aa75c2d | 19 | // { dg-require-fileio "" } |
d4fd5c49 | 20 | |
21 | #include <fstream> | |
22 | #include <testsuite_hooks.h> | |
23 | ||
24 | void test01() | |
25 | { | |
26 | const wchar_t* name = L"ifstream_members-1.txt"; | |
27 | std::ifstream ifs(name); | |
28 | VERIFY( ifs.is_open() ); | |
29 | } | |
30 | ||
31 | void test02() | |
32 | { | |
33 | const wchar_t name[] = L"ifstream_members-1.txt"; | |
34 | std::wifstream wifs(name, std::wios::in); | |
35 | VERIFY( wifs.is_open() ); | |
36 | } | |
37 | ||
38 | #if __cplusplus >= 201103L | |
39 | using std::is_constructible; | |
40 | using std::ifstream; | |
41 | using std::wifstream; | |
42 | using std::ios; | |
43 | using std::wios; | |
44 | static_assert(is_constructible<ifstream, const wchar_t*>::value); | |
45 | static_assert(is_constructible<ifstream, wchar_t*>::value); | |
46 | static_assert(is_constructible<ifstream, const wchar_t(&)[1]>::value); | |
47 | static_assert(is_constructible<ifstream, wchar_t(&)[1]>::value); | |
48 | static_assert(is_constructible<ifstream, const wchar_t*, ios::openmode>::value); | |
49 | static_assert(is_constructible<ifstream, wchar_t*, ios::openmode>::value); | |
50 | static_assert(is_constructible<ifstream, const wchar_t(&)[1], ios::openmode>::value); | |
51 | static_assert(is_constructible<ifstream, wchar_t(&)[1], ios::openmode>::value); | |
52 | static_assert(is_constructible<wifstream, const wchar_t*>::value); | |
53 | static_assert(is_constructible<wifstream, wchar_t*>::value); | |
54 | static_assert(is_constructible<wifstream, const wchar_t(&)[1]>::value); | |
55 | static_assert(is_constructible<wifstream, wchar_t(&)[1]>::value); | |
56 | static_assert(is_constructible<wifstream, const wchar_t*, wios::openmode>::value); | |
57 | static_assert(is_constructible<wifstream, wchar_t*, wios::openmode>::value); | |
58 | static_assert(is_constructible<wifstream, const wchar_t(&)[1], wios::openmode>::value); | |
59 | static_assert(is_constructible<wifstream, wchar_t(&)[1], wios::openmode>::value); | |
60 | #endif | |
61 | ||
62 | int | |
63 | main() | |
64 | { | |
65 | test01(); | |
66 | test02(); | |
67 | } |