Bug 85308 - Stringstream constructor fails
Summary: Stringstream constructor fails
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-09 21:16 UTC by C.W.Holeman II
Modified: 2018-04-09 22:07 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
-save-temps and example (1.47 KB, text/plain)
2018-04-09 21:16 UTC, C.W.Holeman II
Details

Note You need to log in before you can comment on or make changes to this bug.
Description C.W.Holeman II 2018-04-09 21:16:17 UTC
Created attachment 43888 [details]
-save-temps and example

When specifying an initial value in a std::streamstring to resulting value of the item is wrong.
Comment 1 Jonathan Wakely 2018-04-09 22:07:20 UTC
That's not a bug, it's how stringstream is supposed to work.

Use
std::stringstream con(BEFORE, std::ios::in|std::ios::out|std::ios::ate);
if you want insertions to happen at the end, after the initial value.