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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-10-24
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Currently __gnu_debug::vector::assign does:

          this->_M_invalidate_all();
          this->_M_update_guaranteed_capacity();

But I think it should be:

            if (__old_data != _Base::data())
              {
                this->_M_invalidate_all();
                this->_M_update_guaranteed_capacity();
              }
            else if (__old_size < _Base::size())
              this->_M_invalidate_after_nth(_Base::size());

where __old_data and __old_size are _Base::data() and _Base::size() before
calling _Base::assign.

Reply via email to