https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83239
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- It was pointed out to me that the allocator in my example should not allocate more than its max_size, so the example isn't reasonable. So the invariant in Martin's patch is OK.