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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.4.0
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
      Known to fail|                            |5.5.0
            Summary|deque<string> bug when      |[12/13/14/15 Regression]
                   |inserting an empty iterator |deque<string> bug when
                   |interval                    |inserting an empty iterator
                   |                            |interval

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This operation was always technically undefined on GCC's std::deque, because
std::copy_backward has a precondition that the result is not in the input
range. It happened to work because the std::string copy assignment operator
(like most copy assignment operators) is safe for self-assignment.

It continued to "work" after r0-84386-g7ffec97f9e0019 replaced
std::copy_backward with std::move_backward (despite that having the same
precondition).

It only started to lose data with my r5-9770-g397c5bf9204cc8 which
re-implemented the std::string move assignment, where the new implementation
left a string empty after self-move-assignment.

Reply via email to