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 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM 10 11 // <strstream> 12 13 // class strstreambuf 14 15 // int overflow(int c); 16 17 #include <iostream> 18 #include <string> 19 #include <strstream> 20 21 #include "test_macros.h" 22 main(int,char **)23int main(int, char**) { 24 std::ostrstream oss; 25 std::string s; 26 27 for (int i = 0; i < 4096; ++i) 28 s.push_back((i % 16) + 'a'); 29 30 oss << s << std::ends; 31 std::cout << oss.str(); 32 oss.freeze(false); 33 34 return 0; 35 } 36