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]

[Bug libstdc++/53984] New: iostream operation throwing exception when exceptions not enabled


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

             Bug #: 53984
           Summary: iostream operation throwing exception when exceptions
                    not enabled
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gccbz.10.petechap@spamgourmet.com


I'm getting an exception thrown in a situation where I believe a failbit should
be set instead.
Is my expectation wrong?

-------------------
#include <fstream>
#include <sstream>

int main()
{
    std::ifstream in(".");
    std::ostringstream out;
    if (in)
      in >> out.rdbuf();
}
-------------------


terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_filebuf::underflow error reading the file
Aborted (core dumped)


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