We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/* * (c) Copyright 2017-2019 by Solid Sands B.V., * Amsterdam, the Netherlands. All rights reserved. * Subject to conditions in the RESTRICTIONS file. */ #include <cstddef> #include <iostream> class My_Class { public: int a; int b; ~My_Class(){}; }; void operator delete[]( void* ptr ) noexcept { std::cout << "====delete with 1 parameters======" << std::endl; ::operator delete(ptr); } void operator delete[]( void* ptr, std::size_t size ) noexcept { std::cout << "====delete with 2 parameters======" << std::endl; ::operator delete(ptr); } int main() { My_Class* pobj = new My_Class[2]; delete[] pobj; }
# The clang result is: ====delete with 1 parameters====== # But gcc result is: ====delete with 2 parameters======
I think clang does not follow c++ spec as follow: https://cplusplus.github.io/CWG/issues/1788.html
The text was updated successfully, but these errors were encountered:
If I understand correctly clang does not support this by default but we use -fsized-deallocation to enable this. See the discussion in C++14: Disable sized deallocation by default due to ABI breakage.
-fsized-deallocation
Although it looks like enabling this by default is being worked on in Enable sized deallocation by default in C++14 onwards but from the last update there are some challenges.
Sorry, something went wrong.
@llvm/issue-subscribers-clang-frontend
@llvm/issue-subscribers-c-14
Now that #90373 landed, this can probably be closed?
No branches or pull requests
I think clang does not follow c++ spec as follow:
https://cplusplus.github.io/CWG/issues/1788.html
The text was updated successfully, but these errors were encountered: