[llvm-bugs] [Bug 25973] New: basic_string::assign(InputIt, InputIt) doesn't provide the strong exception safety guarantee

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 30 08:10:38 PST 2015


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

            Bug ID: 25973
           Summary: basic_string::assign(InputIt, InputIt) doesn't provide
                    the strong exception safety guarantee
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rs2740 at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

Per [string.require]/2:

If any member function or operator of basic_string throws an exception, that
function or operator shall have no other effect.

libc++'s implementation of assign(InputIterator, InputIterator) does clear()
followed by push_back() in a loop, which clearly doesn't meet this requirement.

-- 
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/20151230/d49c6bf7/attachment.html>


More information about the llvm-bugs mailing list