Post

Replies

Boosts

Views

Activity

Reply to Important bug for C++ object dynamic delete in XCode Compiler
I think i find the answer: in the stackoverflow : If the static type of the object that is being deleted differs from its dynamic type (such as when deleting a polymorphic object through a pointer to base), and if the destructor in the static type is virtual, the single object form of delete begins lookup of the deallocation function's name starting from the point of definition of the final overrider of its virtual destructor. Regardless of which deallocation function would be executed at run time, the statically visible version of operator delete must be accessible in order to compile. In other cases, when deleting an array through a pointer to base, or when deleting through pointer to base with non-virtual destructor, the behavior is undefined. so in my case the different compiler handle this in different ways。
Aug ’22