https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95759
Bug ID: 95759 Summary: Sized deallocation function can not be matched Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hujiangping at cn dot fujitsu.com Target Milestone: --- Accroding to https://gcc.gnu.org/projects/cxx-status.html#cxx14, sized dealloction function which is one of C++14 language features should have been implemented from GCC 5. But, I cann't get the following replaced one matched. --- #include <cstdlib> #include <cassert> #include <stdio.h> void* operator new[](std::size_t sz){ printf("new called\n"); void* m = malloc(sz); assert(m); return m; } void operator delete[](void*p)noexcept { printf("usual deallocation called\n"); return free(p); } void operator delete[](void*p, std::size_t size)noexcept { printf("sized deallocation called\n"); return free(p); } void test() { delete[] new int[3]; } int main() { test(); } --- The gcc version and command used are as follow: --- $ /home/extra_mnt/build_gcc/bin_gcc-master/bin/g++ --version g++ (GCC) 11.0.0 20200519 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ /home/extra_mnt/build_gcc/bin_gcc-master/bin/g++ --std=c++14 tmp.cpp && ./a.out new called usual deallocation called --- I guess if the sized deallocation funtion may not replaceable, or there is a mis-matched bug?