Experimenting with I/O I get an exception where no exception should have been thrown:
#include
#include
int main()
{
st
It's a bug, and clang v3.4 with libc++ doesn't exhibit this behaviour; GCC 4.8's libstdc++ still does.
From the libstdc++ source and the text of the exception, I'd say that basic_ios::clear is not catching exceptions thrown from down the call stack and applying the "are exception flags in play?" logic before potentially rethrowing them.
It was already raised last year as bug 53984.