{ Resending this, as it was apparently lost. }

Hi,

this program:

  #include <fstream>
  #include <iostream>

  int
  main()
  {
      std::fstream        fs ;
      fs.clear( std::ios_base::eofbit ) ;

      fs << "this isn't actually output" ;

      if ( ( fs.rdstate() & std::ios_base::badbit ) != 0 ) {
          std::cout << "badbit set" << std::endl ;
      }
  }

prints "badbit set" on Visual C++ 2015 and prints nothing with GCC or
Clang+libstdc++.

Does the standard allow both behaviors?

--
--
.:: Gennaro Prota ::.
.:: https://about.me/gennaro.prota ::.