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

            Bug ID: 79254
           Summary: basic_string::operator= isn't exception safe
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugzilla at daryl dot haresign.com
  Target Milestone: ---

Assigning one string to another, where they have non-equal
propagate-on-copy-assignment allocators, does a `_M_destroy()`, followed by an
`assign()`.  The `assign()` may throw, which leaves the string in a cleared
state.

This seems to violate the requirement specified here:
  http://eel.is/c++draft/basic.string#string.require-2

A contrived example to show this:
  http://coliru.stacked-crooked.com/a/1891a2678a9589d3

Reply via email to