This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
668. Throwing an exception from the destructor of a local static objectSection: 14.6.2 [except.terminate] Status: CD2 Submitter: Daniel Krügler Date: 16 December 2007[Voted into the WP at the March, 2009 meeting.]
The destruction of local static objects occurs at the same time as that of non-local objects (6.10.3.3 [basic.start.dynamic] paragraph 1) and the execution of functions registered with std::atexit (paragraph 3). According to 14.6.2 [except.terminate] paragraph 1, std::terminate is called if a destructor for a non-local object or a function registered with std::atexit exits via an exception, but the Standard is silent about the result of throwing an exception from a destructor for a local static object. Presumably this is an oversight and the same rules should apply to destruction of local static objects.
Proposed resolution (September, 2008):
Change 14.6.2 [except.terminate] paragraph 1, fourth bullet as indicated, and add an additional bullet to follow it:
when construction or destruction of a non-local object with static or thread storage duration exits using an exception (6.10.3.2 [basic.start.static]), or
when destruction of an object with static or thread storage duration exits using an exception (6.10.3.3 [basic.start.dynamic]), or
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4