https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106093

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> in particular the new allocated storage is processed but the old size is
> used?!

Yes, that seems correct.

We're resizing the vector from N to N+1 (where N happens to be 0). The new size
is greater than the existing capacity, so we allocate N+1 elements, then copy
the existing N elements into the new storage (which uses old_finish -
old_start).

Afterwards, we would actually construct the new element in the new storage, but
the warning happens while just copying the elements from the old storage to the
new.

Reply via email to