This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/10074: Delimeters in an ifstream ignored when reading a std::string


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]