Annex F (informative) Core undefined behavior [ub]

F.2 [basic]: Basics [ub.basic]

F.2.15[ub:basic.stc.alloc.dealloc.constraint]

If the behavior of an allocation or deallocation function does not satisfy the semantic constraints specified in [basic.stc.dynamic.allocation] and [basic.stc.dynamic.deallocation], the behavior is undefined.
[Example 1: #include <new> void* operator new(std::size_t sz) { if (sz == 0) return nullptr; // undefined behavior, should return non-null pointer return std::malloc(1); // undefined behavior, if successful should return allocation with // length in bytes is at least as large as the requested size } void operator delete(void* ptr) noexcept { throw 0; // undefined behavior, terminates by throwing an exception } — end example]