这是未定义的行为.
The C++ standard says:
3.7.4.2 Deallocation functions
3 … Otherwise,the behavior is unde?ned
if the value supplied to operator delete(void*)
in the standard library is not one of the values returned
by a previous invocation of either operator new(std::size_t)
or operator new(std::size_t,const
std::nothrow_t&)
in the standard library,and the behavior is unde?ned if the value supplied to operator
delete[](void*)
in the standard library is not one of the values returned by a previous invocation of
either operator new[](std::size_t)
or operator new[](std::size_t,const std::nothrow_t&)
in the
standard library.
4 … The e?ect of using an invalid pointer value (including passing it to a deallocation function) is unde?ned. (On some implementations,it causes a system-generated runtime fault.)