Title
Exceptions “allowed” by a noexcept-specification
Status
c++11
Section
14.5 [except.spec]
Submitter
Jens Maurer

Created on 2010-11-02.00:00:00 last changed 96 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2010-11-15.00:00:00

Proposed resolution (November, 2010) [SUPERSEDED]:

Change 14.5 [except.spec] paragraph 8 as follows:

A function is said to allow an exception of type E if the constant-expression in its noexcept-specification evaluates to false or its dynamic-exception-specification contains a type T for which a handler of type T would be a match (14.4 [except.handle]) for an exception of type E.
Date: 2018-02-27.00:00:00

According to 14.5 [except.spec] paragraph2 8 and 9,

A function is said to allow an exception of type E if its dynamic-exception-specification contains a type T for which a handler of type T would be a match (14.4 [except.handle]) for an exception of type E.

Whenever an exception is thrown and the search for a handler (14.4 [except.handle]) encounters the outermost block of a function with an exception-specification that does not allow the exception, then,

  • if the exception-specification is a dynamic-exception-specification, the function std::unexpected() is called (_N4606_.15.5.2 [except.unexpected]),

  • otherwise, the function std::terminate() is called (14.6.2 [except.terminate]).

This does not define what it means for a noexcept-specification to allow an exception.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3409
2011-04-10 00:00:00adminsetstatus: review -> fdis
2010-11-29 00:00:00adminsetmessages: + msg3116
2010-11-02 00:00:00admincreate