[libc++] [LIBCXX-DEBUG-FIXME] Fix an iterator-invalidation issue in string::assign.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 27 Apr 2021 13:10:04 +0000 (09:10 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Wed, 5 May 2021 20:20:53 +0000 (16:20 -0400)
commitdb9425cb060bd076fcdcbb5a37bfd992deff2086
tree3a19bcb10e0afe93570c7b52e798926b4886a43e
parent0b10bb7ddd3c92465ef12d52e88614e6b4c5ef27
[libc++] [LIBCXX-DEBUG-FIXME] Fix an iterator-invalidation issue in string::assign.

This appears to be a bug in our string::assign: when assigning into
a longer string, from a shorter snippet of itself, we invalidate
iterators before doing the copy. We should invalidate them afterward.
Also drive-by improve the formatting of a function header.

Differential Revision: https://reviews.llvm.org/D101675
libcxx/include/string
libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp