http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59267
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I think you forgot to go back in the stream so is.str() returns the string from the current location. That is the stream current location is at the end of the input string and you should go back to start of the stream.