http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60270
Bug ID: 60270 Summary: [C++1y] std::quoted is too eager to clear the string Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Lars Gullik Bjønnes pointed out that we clear the string too early in std::quoted, which causes this to fail: #include <string> #include <sstream> #include <iomanip> #include <cassert> int main() { std::istringstream in; std::string s = "xxx"; in >> s; assert( !s.empty() ); in >> std::quoted(s); assert( !s.empty() ); // fails }