152 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <iosfwd>10 11#include <iosfwd>12 13#include "test_macros.h"14 15#ifndef TEST_HAS_NO_WIDE_CHARACTERS16# include <cwchar>17#endif18 19template <class Ptr> void test()20{21 Ptr p = 0;22 ((void)p); // Prevent unused warning23}24 25int main(int, char**)26{27 test<std::char_traits<char>* >();28#ifndef TEST_HAS_NO_WIDE_CHARACTERS29 test<std::char_traits<wchar_t>* >();30#endif31 32 test<std::basic_ios<char>* >();33#ifndef TEST_HAS_NO_WIDE_CHARACTERS34 test<std::basic_ios<wchar_t>* >();35#endif36 37 test<std::basic_streambuf<char>* >();38#ifndef TEST_HAS_NO_WIDE_CHARACTERS39 test<std::basic_streambuf<wchar_t>* >();40#endif41 42 test<std::basic_istream<char>* >();43#ifndef TEST_HAS_NO_WIDE_CHARACTERS44 test<std::basic_istream<wchar_t>* >();45#endif46 47 test<std::basic_ostream<char>* >();48#ifndef TEST_HAS_NO_WIDE_CHARACTERS49 test<std::basic_ostream<wchar_t>* >();50#endif51 52 test<std::basic_iostream<char>* >();53#ifndef TEST_HAS_NO_WIDE_CHARACTERS54 test<std::basic_iostream<wchar_t>* >();55#endif56 57 test<std::basic_stringbuf<char>* >();58#ifndef TEST_HAS_NO_WIDE_CHARACTERS59 test<std::basic_stringbuf<wchar_t>* >();60#endif61 62 test<std::basic_istringstream<char>* >();63#ifndef TEST_HAS_NO_WIDE_CHARACTERS64 test<std::basic_istringstream<wchar_t>* >();65#endif66 67 test<std::basic_ostringstream<char>* >();68#ifndef TEST_HAS_NO_WIDE_CHARACTERS69 test<std::basic_ostringstream<wchar_t>* >();70#endif71 72 test<std::basic_stringstream<char>* >();73#ifndef TEST_HAS_NO_WIDE_CHARACTERS74 test<std::basic_stringstream<wchar_t>* >();75#endif76 77 test<std::basic_filebuf<char>* >();78#ifndef TEST_HAS_NO_WIDE_CHARACTERS79 test<std::basic_filebuf<wchar_t>* >();80#endif81 82 test<std::basic_ifstream<char>* >();83#ifndef TEST_HAS_NO_WIDE_CHARACTERS84 test<std::basic_ifstream<wchar_t>* >();85#endif86 87 test<std::basic_ofstream<char>* >();88#ifndef TEST_HAS_NO_WIDE_CHARACTERS89 test<std::basic_ofstream<wchar_t>* >();90#endif91 92 test<std::basic_fstream<char>* >();93#ifndef TEST_HAS_NO_WIDE_CHARACTERS94 test<std::basic_fstream<wchar_t>* >();95#endif96 97 test<std::istreambuf_iterator<char>* >();98#ifndef TEST_HAS_NO_WIDE_CHARACTERS99 test<std::istreambuf_iterator<wchar_t>* >();100#endif101 102 test<std::ostreambuf_iterator<char>* >();103#ifndef TEST_HAS_NO_WIDE_CHARACTERS104 test<std::ostreambuf_iterator<wchar_t>* >();105#endif106 107 test<std::ios* >();108#ifndef TEST_HAS_NO_WIDE_CHARACTERS109 test<std::wios*>();110#endif111 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_CHARACTERS128 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#endif143 144 test<std::fpos<std::mbstate_t>*>();145 test<std::streampos* >();146#ifndef TEST_HAS_NO_WIDE_CHARACTERS147 test<std::wstreampos* >();148#endif149 150 return 0;151}152