Title
Use [[noreturn]] attribute in the library
Status
c++11
Section
[support]
Submitter
Howard Hinnant

Created on 2009-03-15.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [support.start.term] p3:

-2- ...

void abort [[noreturn]] (void)

-3- ...

-6- ...

void exit [[noreturn]] (int status)

-7- ...

-11- ...

void quick_exit [[noreturn]] (int status)

-12- ...

Change the <exception> synopsis in [support.exception]:

void unexpected [[noreturn]] ();
...
void terminate [[noreturn]] ();
...
void rethrow_exception [[noreturn]] (exception_ptr p);
...
template <class T> void throw_with_nested [[noreturn]] (T&& t); // [[noreturn]]

Change [unexpected]:

void unexpected [[noreturn]] ();

Change [terminate]:

void terminate [[noreturn]] ();

Change [propagation]:

void rethrow_exception [[noreturn]] (exception_ptr p);

In the synopsis of [except.nested] and the definition area change:

template <class T> void throw_with_nested [[noreturn]] (T&& t); // [[noreturn]]
Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to Tentatively Ready.

Date: 2010-10-21.18:28:33

[ Summit: ]

Agreed.

Date: 2012-10-21.13:19:07

Addresses UK 189 and JP 27 [CD1]

The addition of the [[noreturn]] attribute to the language will be an important aid for static analysis tools.

The following functions should be declared in C++ with the [[noreturn]] attribute: abort exit quick_exit terminate unexpected rethrow_exception throw_with_nested.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg560
2010-10-21 18:28:33adminsetmessages: + msg559
2010-10-21 18:28:33adminsetmessages: + msg558
2009-03-15 00:00:00admincreate