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

            Bug ID: 78389
           Summary: list::merge and list::sort are not exception safe
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

If a comparison throws in the middle of the loop,
- list::merge will have spliced some elements over without updating the size of
the lists.
- list::sort will destroy any elements that have been transferred into the
temporary lists.

The former leaves the lists in an invariant-broken state. The latter is
surprising at best.

Reply via email to