This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/10074: Delimeters in an ifstream ignored when reading a std::string
- From: trent at itee dot uq dot edu dot au
- To: gcc-gnats at gcc dot gnu dot org
- Date: 14 Mar 2003 05:25:09 -0000
- Subject: libstdc++/10074: Delimeters in an ifstream ignored when reading a std::string
- Reply-to: trent at itee dot uq dot edu dot au
>Number: 10074
>Category: libstdc++
>Synopsis: Delimeters in an ifstream ignored when reading a std::string
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 14 05:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: trent at itee dot uq dot edu dot au
>Release: 3.2.1
>Organization:
>Environment:
>Description:
As of gcc version 3.2.1, reading a std::string from an std::ifstream results in the entire file contents being read, ignoring any delimiters in the file. This was not the behaviour of gcc 3.2 and prior.
>How-To-Repeat:
Compile the follow code fragment:
#include <iostream>
#include <fstream>
int main() {
std::ifstream inf("input");
std::string s;
inf >> s;
std::cerr << "read: '" << s << "'" << std::endl;
inf.close();
}
and create inputfile with multiple lines.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: