Title
Deleted operator delete
Status
drafting
Section
7.6.2.8 [expr.new]
Submitter
John Spicer

Created on 2009-05-20.00:00:00 last changed 19 months ago

Messages

Date: 2023-04-15.00:00:00

Additional notes (April, 2023):

An additional use-case for a deleted deallocation function would be to ensure that the initialization of the object is not potentially-throwing.

For cases where the deallocation function is never called from the constructor, access checking for it should not be done.

Date: 2009-07-15.00:00:00

Notes from the July, 2009 meeting:

The rationale for defining a deallocation function as deleted would presumably be to prevent such objects from being freed. Treating the new-expression as a use of such a deallocation function would mean that such objects could not be created in the first place. There is already an exemption from freeing an object if “a suitable deallocation function [cannot] be found;” a deleted deallocation function should be treated similarly.

Date: 2022-09-25.18:08:42

It is not clear from 7.6.2.8 [expr.new] whether a deleted operator delete is referenced by a new-expression in which there is no initialization or in which the initialization cannot throw an exception, rendering the program ill-formed. (The question also arises as to whether such a new-expression constitutes a “use” of the deallocation function in the sense of 6.3 [basic.def.odr].)

History
Date User Action Args
2023-04-28 21:41:42adminsetmessages: + msg7262
2009-08-03 00:00:00adminsetmessages: + msg2191
2009-08-03 00:00:00adminsetstatus: open -> drafting
2009-05-20 00:00:00admincreate