Title
Exceptions and deallocation functions
Status
review
Section
6.8.6.5.3 [basic.stc.dynamic.deallocation]
Submitter
Richard Smith

Created on 2014-11-13.00:00:00 last changed 1 month ago

Messages

Date: 2025-10-15.00:00:00

Additional notes (October, 2025)

Paper P3424 (Define Delete With Throwing Exception Specification) (approved by EWG for C++29) will make the declaration of a potentially-throwing deallocation function ill-formed, making this issue moot.

Date: 2014-11-13.00:00:00

According to 6.8.6.5.3 [basic.stc.dynamic.deallocation] paragraph 4,

If a deallocation function terminates by throwing an exception, the behavior is undefined.

This seems to be in conflict with the provisions of 14.5 [except.spec]: if a deallocation function throws an exception that is not allowed by its exception-specification, 14.5 [except.spec] paragraph 9 would appear to give the program defined behavior (calling std::unexpected() or std::terminate()). (Note that 14.5 [except.spec] paragraph 18 explicitly allows an explicit exception-specification for a deallocation function.)

History
Date User Action Args
2025-10-26 11:40:52adminsetmessages: + msg8177
2025-10-26 11:40:52adminsetstatus: drafting -> review
2017-02-06 00:00:00adminsetstatus: open -> drafting
2014-11-13 00:00:00admincreate