You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reland [MS][clang] Add support for vector deleting destructors
MSVC supports and extension allowing to delete an array of objects
via pointer whose static type doesn't match its dynamic type. This is
done via generation of special destructors - vector deleting
destructors. MSVC's virtual tables always contain pointer to vector
deleting destructor for classes with virtual destructors, so not having
this extension not having this extension implemented causes clang to generate
code that is not compatible with the code generated by MSVC, because
clang always puts pointer to a scalar deleting destructor to the vtable.
As a bonus the deletion of an array of polymorphic object will work just
like it does with MSVC - no memory leaks and correct destructors are
called.
This patch will cause clang to emit code that is compatible with code
produced by MSVC but not compatible with code produced with clang of
older versions, so the new behavior can be disabled via passing
-fclang-abi-compat=21 (or lower).
This is yet another attempt to land vector deleting destructors support
originally implemented by llvm#133451.
This PR contains fixes for issues reported in the original PR as well as
fixes for issues related to operator delete[] search reported in
several issues like
llvm#133950 (comment)llvm#134265Fixesllvm#19772
0 commit comments