]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_ofstream/cons/wchar_t/1.cc
1 // Copyright (C) 2018-2021 Free Software Foundation, Inc.
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)
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.
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/>.
18 // { dg-do run { target *-*-mingw* } }
19 // { dg-require-fileio "" }
22 #include <testsuite_hooks.h>
26 const wchar_t* name
= L
"ofstream_name.txt";
27 std::ofstream
ofs(name
);
28 VERIFY( ofs
.is_open() );
33 const wchar_t name
[] = L
"ofstream_name.txt";
34 std::wofstream
wofs(name
, std::wios::out
);
35 VERIFY( wofs
.is_open() );
38 #if __cplusplus >= 201103L
39 using std::is_constructible
;
44 static_assert(is_constructible
<ofstream
, const wchar_t*>::value
);
45 static_assert(is_constructible
<ofstream
, wchar_t*>::value
);
46 static_assert(is_constructible
<ofstream
, const wchar_t(&)[1]>::value
);
47 static_assert(is_constructible
<ofstream
, wchar_t(&)[1]>::value
);
48 static_assert(is_constructible
<ofstream
, const wchar_t*, ios::openmode
>::value
);
49 static_assert(is_constructible
<ofstream
, wchar_t*, ios::openmode
>::value
);
50 static_assert(is_constructible
<ofstream
, const wchar_t(&)[1], ios::openmode
>::value
);
51 static_assert(is_constructible
<ofstream
, wchar_t(&)[1], ios::openmode
>::value
);
52 static_assert(is_constructible
<wofstream
, const wchar_t*>::value
);
53 static_assert(is_constructible
<wofstream
, wchar_t*>::value
);
54 static_assert(is_constructible
<wofstream
, const wchar_t(&)[1]>::value
);
55 static_assert(is_constructible
<wofstream
, wchar_t(&)[1]>::value
);
56 static_assert(is_constructible
<wofstream
, const wchar_t*, wios::openmode
>::value
);
57 static_assert(is_constructible
<wofstream
, wchar_t*, wios::openmode
>::value
);
58 static_assert(is_constructible
<wofstream
, const wchar_t(&)[1], wios::openmode
>::value
);
59 static_assert(is_constructible
<wofstream
, wchar_t(&)[1], wios::openmode
>::value
);