[llvm-bugs] [Bug 31779] New: basic_string::operator= isn't exception safe

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 26 15:15:14 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31779

            Bug ID: 31779
           Summary: basic_string::operator= isn't exception safe
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugs at daryl.haresign.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

Assigning one string to another, where they have non-equal
propagate-on-copy-assignment allocators, does a `clear()`, 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/c43a723d04878890

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170126/ee3420ff/attachment.html>


More information about the llvm-bugs mailing list