]>
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* } } | |
19 | ||
20 | #include <fstream> | |
21 | #include <testsuite_hooks.h> | |
22 | ||
23 | void test01() | |
24 | { | |
25 | const wchar_t* name = L"fstream_name.txt"; | |
26 | std::fstream fs(name, std::wios::out); | |
27 | VERIFY( fs.is_open() ); | |
28 | } | |
29 | ||
30 | void test02() | |
31 | { | |
32 | const wchar_t name[] = L"fstream_name.txt"; | |
33 | std::wfstream wfs(name, std::wios::in|std::wios::out); | |
34 | VERIFY( wfs.is_open() ); | |
35 | } | |
36 | ||
37 | #if __cplusplus >= 201103L | |
38 | using std::is_constructible; | |
39 | using std::fstream; | |
40 | using std::wfstream; | |
41 | using std::ios; | |
42 | static_assert(is_constructible<fstream, const wchar_t*>::value); | |
43 | static_assert(is_constructible<fstream, wchar_t*>::value); | |
44 | static_assert(is_constructible<fstream, const wchar_t(&)[1]>::value); | |
45 | static_assert(is_constructible<fstream, wchar_t(&)[1]>::value); | |
46 | static_assert(is_constructible<fstream, const wchar_t*, ios::openmode>::value); | |
47 | static_assert(is_constructible<fstream, wchar_t*, ios::openmode>::value); | |
48 | static_assert(is_constructible<fstream, const wchar_t(&)[1], ios::openmode>::value); | |
49 | static_assert(is_constructible<fstream, wchar_t(&)[1], ios::openmode>::value); | |
50 | static_assert(is_constructible<wfstream, const wchar_t*>::value); | |
51 | static_assert(is_constructible<wfstream, wchar_t*>::value); | |
52 | static_assert(is_constructible<wfstream, const wchar_t(&)[1]>::value); | |
53 | static_assert(is_constructible<wfstream, wchar_t(&)[1]>::value); | |
54 | static_assert(is_constructible<wfstream, const wchar_t*, ios::openmode>::value); | |
55 | static_assert(is_constructible<wfstream, wchar_t*, ios::openmode>::value); | |
56 | static_assert(is_constructible<wfstream, const wchar_t(&)[1], ios::openmode>::value); | |
57 | static_assert(is_constructible<wfstream, wchar_t(&)[1], ios::openmode>::value); | |
58 | #endif | |
59 | ||
60 | int | |
61 | main() | |
62 | { | |
63 | test01(); | |
64 | test02(); | |
65 | } |