https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20150
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WONTFIX Status|ASSIGNED |RESOLVED --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- The Cpp17Allocator requirements in the standard say: "If n == 0, the return value is unspecified." I see no great need to change anything here. We should ensure that the library is not trying to allocate zero bytes (e.g. PR 100153) but I don't think we need to change how our allocators behave when asked to do that. N.B. If we did change it, we'd need to make deallocate check for a non-null pointer even if n==0, because the allocation could have come from a TU compiled with an older libstdc++ which still did call operator new for n==0.