45 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// <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 19template <class CharT>20struct testbuf21 : public std::basic_streambuf<CharT>22{23 testbuf() {}24};25 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#ifndef TEST_HAS_NO_WIDE_CHARACTERS35 {36 testbuf<wchar_t> sb;37 std::wostream os(&sb);38 os << std::setfill(L'*');39 assert(os.fill() == L'*');40 }41#endif42 43 return 0;44}45