[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 11:48:55 PDT 2024


AaronBallman wrote:

> > ; Function Attrs: nobuiltin allocsize(0)
> > declare dso_local noundef nonnull ptr @"??2 at YAPEAX_K@Z"(i64 noundef %0) #6
> 
> That's probably the problem. We do not "see" the definition of the operator delete. Is that "exported" on msvc?

That one demangles to `void * __ptr64 __cdecl operator new(unsigned __int64)`, so the problem is more likely to be with:

`declare dso_local void @"??3 at YAXPEAX_K@Z"(ptr noundef %0, i64 noundef %1) #1`

because that demangles to `void __cdecl operator delete(void * __ptr64,unsigned __int64)`.

Not entirely certain what you're asking, but MSVC CRT does have a definition for sized delete:
```
_CRT_SECURITYCRITICAL_ATTRIBUTE
void __CRTDECL operator delete(void* const block, size_t const) noexcept
{
    operator delete(block);
}
```
in `crt\src\vcruntime\delete_scalar_size.cpp`

https://github.com/llvm/llvm-project/pull/83774


More information about the cfe-commits mailing list