Created on 2011-03-10.00:00:00 last changed 118 months ago
Additional note, April, 2015:
EWG has decided not to make a change in this area. See EWG issue 99.
Rationale (August, 2011):
The specification is as intended; changes to the restriction would need to be considered in a larger context by EWG.
It is currently undefined behavior to delete a derived-class object via a pointer to a base class unless the base class has a virtual destructor. It has been suggesed that this could be allowed for a standard-layout class. If so, presumably the caveats about a deallocation function or non-trivial destructor found in 7.6.2.9 [expr.delete] paragraph 5 that currently apply to incomplete types would need to be extended to apply to the derived class in such cases.
Another objection that was raised is that such a change would make it more difficult to extend C++ in the future to have global deallocation functions that can take the size of the object being deleted as an argument, as is currently possible for member deallocation functions.
History | |||
---|---|---|---|
Date | User | Action | Args |
2015-04-13 00:00:00 | admin | set | messages: + msg5429 |
2015-04-13 00:00:00 | admin | set | status: extension -> nad |
2012-02-27 00:00:00 | admin | set | messages: + msg3863 |
2011-03-10 00:00:00 | admin | create |