The following code prints "true" with 4.3.3, but "false" with 4.4.2 and
4.5-20091231. I think printing "true" is correct or am I missing something?

#include <iostream>
#include <iomanip>
#include <sstream>

int main()
{
  bool result;
  std::istringstream is( "true" );
  is >> std::boolalpha >> result;
  std::cout << std::boolalpha << is.eof() << std::endl;
}


-- 
           Summary: istream.eof() returns wrong value after reading bool
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot frey at gmx dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42600

Reply via email to