[cfe-dev] is delete on abstract with non-virtal ever safe?

emmanuel.attia emmanuel.attia at philips.com
Sat Oct 5 10:21:35 PDT 2013


I agree that the 5.3.5 rule is contradictory into what I do, but introduction
of chap 5 states:

"2. Operators can be overloaded, that is, given meaning when applied to
expressions of class type (clause 9) or enumeration type (7.2). Uses of
overloaded operators are transformed into function calls as described in
13.5. Overloaded operators obey the rules for syntax specified in clause 5,
but the requirements of operand  type, lvalue, and evaluation order are
replaced by the rules for function call."

So is 5.3.5 really a requirement of any delete operator or only of the
default one ?

For the default delete operator since the behavior is to free the memory it
would make sense to require the destructor of the object to be callable by
putting a virtual destructor in the base interface.



--
View this message in context: http://clang-developers.42468.n3.nabble.com/is-delete-on-abstract-with-non-virtal-ever-safe-tp4025653p4034904.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list