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// <iosfwd>
10
11#include <iosfwd>
12
13#include "test_macros.h"
14
15#ifndef TEST_HAS_NO_WIDE_CHARACTERS
16# include <cwchar>
17#endif
18
19template <class Ptr> void test()
20{
21 Ptr p = 0;
22 ((void)p); // Prevent unused warning
23}
24
25int main(int, char**)
26{
27 test<std::char_traits<char>* >();
28#ifndef TEST_HAS_NO_WIDE_CHARACTERS
29 test<std::char_traits<wchar_t>* >();
30#endif
31
32 test<std::basic_ios<char>* >();
33#ifndef TEST_HAS_NO_WIDE_CHARACTERS
34 test<std::basic_ios<wchar_t>* >();
35#endif
36
37 test<std::basic_streambuf<char>* >();
38#ifndef TEST_HAS_NO_WIDE_CHARACTERS
39 test<std::basic_streambuf<wchar_t>* >();
40#endif
41
42 test<std::basic_istream<char>* >();
43#ifndef TEST_HAS_NO_WIDE_CHARACTERS
44 test<std::basic_istream<wchar_t>* >();
45#endif
46
47 test<std::basic_ostream<char>* >();
48#ifndef TEST_HAS_NO_WIDE_CHARACTERS
49 test<std::basic_ostream<wchar_t>* >();
50#endif
51
52 test<std::basic_iostream<char>* >();
53#ifndef TEST_HAS_NO_WIDE_CHARACTERS
54 test<std::basic_iostream<wchar_t>* >();
55#endif
56
57 test<std::basic_stringbuf<char>* >();
58#ifndef TEST_HAS_NO_WIDE_CHARACTERS
59 test<std::basic_stringbuf<wchar_t>* >();
60#endif
61
62 test<std::basic_istringstream<char>* >();
63#ifndef TEST_HAS_NO_WIDE_CHARACTERS
64 test<std::basic_istringstream<wchar_t>* >();
65#endif
66
67 test<std::basic_ostringstream<char>* >();
68#ifndef TEST_HAS_NO_WIDE_CHARACTERS
69 test<std::basic_ostringstream<wchar_t>* >();
70#endif
71
72 test<std::basic_stringstream<char>* >();
73#ifndef TEST_HAS_NO_WIDE_CHARACTERS
74 test<std::basic_stringstream<wchar_t>* >();
75#endif
76
77 test<std::basic_filebuf<char>* >();
78#ifndef TEST_HAS_NO_WIDE_CHARACTERS
79 test<std::basic_filebuf<wchar_t>* >();
80#endif
81
82 test<std::basic_ifstream<char>* >();
83#ifndef TEST_HAS_NO_WIDE_CHARACTERS
84 test<std::basic_ifstream<wchar_t>* >();
85#endif
86
87 test<std::basic_ofstream<char>* >();
88#ifndef TEST_HAS_NO_WIDE_CHARACTERS
89 test<std::basic_ofstream<wchar_t>* >();
90#endif
91
92 test<std::basic_fstream<char>* >();
93#ifndef TEST_HAS_NO_WIDE_CHARACTERS
94 test<std::basic_fstream<wchar_t>* >();
95#endif
96
97 test<std::istreambuf_iterator<char>* >();
98#ifndef TEST_HAS_NO_WIDE_CHARACTERS
99 test<std::istreambuf_iterator<wchar_t>* >();
100#endif
101
102 test<std::ostreambuf_iterator<char>* >();
103#ifndef TEST_HAS_NO_WIDE_CHARACTERS
104 test<std::ostreambuf_iterator<wchar_t>* >();
105#endif
106
107 test<std::ios* >();
108#ifndef TEST_HAS_NO_WIDE_CHARACTERS
109 test<std::wios*>();
110#endif
111
112 test<std::streambuf*>();
113 test<std::istream* >();
114 test<std::ostream* >();
115 test<std::iostream* >();
116
117 test<std::stringbuf* >();
118 test<std::istringstream*>();
119 test<std::ostringstream*>();
120 test<std::stringstream* >();
121
122 test<std::filebuf* >();
123 test<std::ifstream*>();
124 test<std::ofstream*>();
125 test<std::fstream* >();
126
127#ifndef TEST_HAS_NO_WIDE_CHARACTERS
128 test<std::wstreambuf*>();
129 test<std::wistream* >();
130 test<std::wostream* >();
131 test<std::wiostream* >();
132
133 test<std::wstringbuf* >();
134 test<std::wistringstream*>();
135 test<std::wostringstream*>();
136 test<std::wstringstream* >();
137
138 test<std::wfilebuf* >();
139 test<std::wifstream*>();
140 test<std::wofstream*>();
141 test<std::wfstream* >();
142#endif
143
144 test<std::fpos<std::mbstate_t>*>();
145 test<std::streampos* >();
146#ifndef TEST_HAS_NO_WIDE_CHARACTERS
147 test<std::wstreampos* >();
148#endif
149
150 return 0;
151}
152

source code of libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp