------- Comment #13 from wwashby at earthlink dot net 2009-08-29 12:50 ------- (In reply to comment #12) > ... > Maybe uncaught_exception assumes that the throw BadE will succeed and doesn't > notice that the BadE object is not fully constructed? >
Apparently that is the case. Here's another test case where throw fails to throw an exception: #include <cstdlib> #include <iostream> #include <exception> void ae() { std::cerr << "At exit std::uncaught_exception() = " << std::boolalpha << std::uncaught_exception() << ".\n"; } struct NoE { NoE() { std::exit(0); } }; int main() { std::atexit(ae); throw NoE(); } /* Output: At exit std::uncaught_exception() = true. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174