]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_ifstream/cons/wchar_t/1.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_ifstream / cons / wchar_t / 1.cc
CommitLineData
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
24void test01()
25{
26 const wchar_t* name = L"ifstream_members-1.txt";
27 std::ifstream ifs(name);
28 VERIFY( ifs.is_open() );
29}
30
31void 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
39using std::is_constructible;
40using std::ifstream;
41using std::wifstream;
42using std::ios;
43using std::wios;
44static_assert(is_constructible<ifstream, const wchar_t*>::value);
45static_assert(is_constructible<ifstream, wchar_t*>::value);
46static_assert(is_constructible<ifstream, const wchar_t(&)[1]>::value);
47static_assert(is_constructible<ifstream, wchar_t(&)[1]>::value);
48static_assert(is_constructible<ifstream, const wchar_t*, ios::openmode>::value);
49static_assert(is_constructible<ifstream, wchar_t*, ios::openmode>::value);
50static_assert(is_constructible<ifstream, const wchar_t(&)[1], ios::openmode>::value);
51static_assert(is_constructible<ifstream, wchar_t(&)[1], ios::openmode>::value);
52static_assert(is_constructible<wifstream, const wchar_t*>::value);
53static_assert(is_constructible<wifstream, wchar_t*>::value);
54static_assert(is_constructible<wifstream, const wchar_t(&)[1]>::value);
55static_assert(is_constructible<wifstream, wchar_t(&)[1]>::value);
56static_assert(is_constructible<wifstream, const wchar_t*, wios::openmode>::value);
57static_assert(is_constructible<wifstream, wchar_t*, wios::openmode>::value);
58static_assert(is_constructible<wifstream, const wchar_t(&)[1], wios::openmode>::value);
59static_assert(is_constructible<wifstream, wchar_t(&)[1], wios::openmode>::value);
60#endif
61
62int
63main()
64{
65 test01();
66 test02();
67}