Movatterモバイル変換


[0]ホーム

URL:


Issue 127 - WG21 CWG Issues
Title
Ambiguity in description of matching deallocation function
Status
tc1
Section
7.6.2.8 [expr.new]
Submitter
Alexander Schiemann

Created on1999-06-08.00:00:00 last changed277 months ago

Messages

msg238 (view)
Date: 2000-10-15.00:00:00

Proposed resolution (10/00):

In 14.3 [except.ctor] paragraph 2, replace

If the object or array was allocated in anew-expression andthenew-expression does not contain anew-placement, thedeallocation function (6.8.6.5.3 [basic.stc.dynamic.deallocation], 11.4.11 [class.free]) is called to free the storage occupied by the object;the deallocation function is chosen as specified in 7.6.2.8 [expr.new]. If the object or array was allocated in anew-expression and thenew-expression contains anew-placement, the storage occupied by the object isdeallocated only if an appropriate placement operator delete is found,as specified in 7.6.2.8 [expr.new].

with

If the object or array was allocated in anew-expression, thematching deallocation function (6.8.6.5.3 [basic.stc.dynamic.deallocation],7.6.2.8 [expr.new], 11.4.11 [class.free]), if any, iscalled to free the storage occupied by the object.

See alsoissue 429.

msg120 (view)
Date: 2003-04-25.00:00:00

If a placement allocation function has default arguments for all itsparameters except the first, it can be called using non-placementsyntax. In such a case, it is not clear whetherthe deallocation function to be called if the constructor terminatesby throwing an expression is determined on the basis ofthe syntax of thenew-expression (i.e., a non-placementdeallocation function)or the declaration of the selected (placement) allocation function.7.6.2.8 [expr.new] paragraph 19indicatesthat the deallocation function must match the declaration of theallocation function.However, 14.3 [except.ctor] says that thedistinction is based on whether thenew-expression containsanew-placement or not.

History
DateUserActionArgs
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

[8]ページ先頭

©2009-2026 Movatter.jp