Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.2.0
-
None
-
All
Description
The test below asserts on i == 512.
test.cpp
#include <sstream> #include <string> #include <cassert> int main () { for (size_t i = 1; i <= 1024; ++i) { std::stringstream strm; std::string s (i, 'a'); strm << s; strm.seekp (-1, std::ios::cur); s.erase (0, 1); strm << "bc"; s.append ("bc"); assert (strm.str () == s); } return 0; }
The test output:
test: test.cpp:15: int main (): Assertion `strm.str () == s' failed. Aborted
Attachments
Issue Links
- relates to
-
STDCXX-795 std::basic_stringbuf::overflow() writes characters at the begin, but not at the current position if reallocation of internal buffer occurs
- Closed