This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
[Voted into the WP at the November, 2010 meeting.]N3092 comment GB 47
The list of reasons for which std::terminate is called needs to be extended to cover several additional cases in C++0x:
when function std::nested_exception::rethrow_nested is called for an object that stores a null exception pointer.
when execution of a function registered with std::at_quick_exit exits using an exception.
when the destructor or a copy constructor of class std::thread is called for the object that is joinable.
Proposed resolution (August, 2010):
Change 14.6.2 [except.terminate] paragraph 1 as follows:
the followingsituations exception handling must be abandoned for less subtle error handling techniques :
when the exception handling mechanism, after completing evaluation of the expression to be thrown but before the exception is caught (14.2 [except.throw]), calls a function that exits via an
uncaughtexception, [Footnote: For example, if the object being thrown is of a class with a copy constructor, std::terminate() will be called if that copy constructor exits with an exception during a throw. —end footnote]
when the exception handling mechanism cannot find a handler for a thrown exception (14.4 [except.handle]), or
when the destruction of an object during stack unwinding (15.2) terminates by throwing an exception, or
when destruction of an object with static or thread storage duration exits
usingan exception (22.214.171.124 [basic.start.dynamic]), or
when execution of a function registered with std::atexit exits
usingan exception (17.5 [support.start.term]), or
when a throw-expression with no operand attempts to rethrow an exception and no exception is being handled (14.2 [except.throw]), or
when std::unexpected throws an exception which is not allowed by the previously violated exception-specification, and std::bad_exception is not included in that exception-specification (_N4606_.15.5.2 [except.unexpected]), or
when the implementation's default unexpected exception handler is called (_N4606_.D.6.1 [unexpected.handler])
Insert the following as a new paragraph following 14.2 [except.throw] paragraph 6:
An exception is considered caught...
Change 14.3 [except.ctor] paragraph 3 as follows:
The process of calling destructors for automatic objects constructed on the path from a try block to a throw-expression is called “stack unwinding.”
[Note:If a destructor called during stack unwinding exits with an exception, std::terminate is called (14.6.2 [except.terminate]). So destructors should generally catch exceptions and not let them propagate out of the destructor. —end note]
Change 126.96.36.199 [basic.start.static] paragraph 6 as follows:
[Note:If the initialization of a non-local variable with static or thread storage duration terminates by throwingan exception, std::terminate is called ( see14.6.2 [except.terminate]). —end note]
Change 188.8.131.52 [basic.start.dynamic] paragraph 1 as follows:
[Note:If the destruction of a non-localobject with static or thread storage duration terminates by throwingan exception, std::terminate is called ( see14.6.2 [except.terminate]). —end note]
Change 17.5 [support.start.term] bullet 8.1 as follows:
First, objects with thread storage duration...
If control leaves a registered function called by exit because the function does not provide a handler for a thrown exception, terminate() shall be called .