Experimenting with I/O I get an exception where no exception should have been thrown:
#include #include int main() { std::ifstream f("/tmp"); std::cout > std::ws) std::cout But the output is:
Exception Flags: 0 terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_filebuf::underflow error reading the file Aborted g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Edit
The test is supposed to fail without exception:
From 27.5.5.4 basic_ios flags functions
void clear(iostate state = goodbit);
4 Postcondition: If rdbuf()!=0 then state == rdstate(); otherwise rdstate()==(state | ios_base::badbit).
5 Effects: If ((state | (rdbuf() ? goodbit : badbit)) & exceptions()) == 0, returns. Otherwise, the function throws an object fail of class basic_ios::failure (27.5.3.1.1), constructed with implementation-defined argument values.
void setstate(iostate state);
6 Effects: Calls clear(rdstate() | state) (which may throw basic_ios::failure (27.5.3.1.1)).