Title
Ambiguity in description of matching deallocation function
Status
tc1
Section
8.3.4 [expr.new]
Submitter
Alexander Schiemann

Created on 1999-06-08.00:00:00 last changed 208 months ago

Messages

Date: 2000-10-15.00:00:00

Proposed resolution (10/00):

In 18.2 [except.ctor] paragraph 2, replace

If the object or array was allocated in a new-expression and the new-expression does not contain a new-placement, the deallocation function (6.7.4.2 [basic.stc.dynamic.deallocation], 15.5 [class.free]) is called to free the storage occupied by the object; the deallocation function is chosen as specified in 8.3.4 [expr.new]. If the object or array was allocated in a new-expression and the new-expression contains a new-placement, the storage occupied by the object is deallocated only if an appropriate placement operator delete is found, as specified in 8.3.4 [expr.new].

with

If the object or array was allocated in a new-expression, the matching deallocation function (6.7.4.2 [basic.stc.dynamic.deallocation], 8.3.4 [expr.new], 15.5 [class.free]), if any, is called to free the storage occupied by the object.

See also issue 429.

Date: 2003-04-25.00:00:00

If a placement allocation function has default arguments for all its parameters except the first, it can be called using non-placement syntax. In such a case, it is not clear whether the deallocation function to be called if the constructor terminates by throwing an expression is determined on the basis of the syntax of the new-expression (i.e., a non-placement deallocation function) or the declaration of the selected (placement) allocation function. 8.3.4 [expr.new] paragraph 19 indicates that the deallocation function must match the declaration of the allocation function. However, 18.2 [except.ctor] says that the distinction is based on whether the new-expression contains a new-placement or not.

History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: drafting -> ready
2000-02-23 00:00:00adminsetmessages: + msg238
2000-02-23 00:00:00adminsetstatus: open -> drafting
1999-06-08 00:00:00admincreate