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 // <iomanip> 10 11 // template<charT> T4 setfill(charT c); 12 13 #include <iomanip> 14 #include <ostream> 15 #include <cassert> 16 17 #include "test_macros.h" 18 19 template <class CharT> 20 struct testbuf 21 : public std::basic_streambuf<CharT> 22 { testbuftestbuf23 testbuf() {} 24 }; 25 main(int,char **)26int main(int, char**) 27 { 28 { 29 testbuf<char> sb; 30 std::ostream os(&sb); 31 os << std::setfill('*'); 32 assert(os.fill() == '*'); 33 } 34 { 35 testbuf<wchar_t> sb; 36 std::wostream os(&sb); 37 os << std::setfill(L'*'); 38 assert(os.fill() == L'*'); 39 } 40 41 return 0; 42 } 43