http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49506
Summary: reusing a file stream object will always get eof after openning Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: gz...@hotmail.com Created attachment 24581 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24581 test programe to reproduce the file stream open-eof bug It seems that if I reuse a std::ifstream object by "open(another_file)" it will always return EOF right away. See the attached file for details. I had confirmed this can be reproduced with gcc 3.3.3 but NOT in gcc 4.3.3. (Not sure which exact version fixed the problem -- I had searched the similar bug description but could not find one ). In a good case, the test program should return 0 silently. In a bad case, the test program print out "eof" and some of the bits of the stream state and return 1;