diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1763,11 +1763,7 @@ template inline void -basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type -#if _LIBCPP_DEBUG_LEVEL == 2 - __pos -#endif - ) +basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type __pos) { #if _LIBCPP_DEBUG_LEVEL == 2 __c_node* __c = __get_db()->__find_c_and_lock(this); @@ -1787,6 +1783,8 @@ } __get_db()->unlock(); } +#else + (void)__pos; #endif // _LIBCPP_DEBUG_LEVEL == 2 } @@ -2361,12 +2359,11 @@ size_type __sz = size(); __grow_by(__cap, __n - __cap, __sz, 0, __sz); } - else - __invalidate_iterators_past(__n); value_type* __p = _VSTD::__to_address(__get_pointer()); traits_type::assign(__p, __n, __c); traits_type::assign(__p[__n], value_type()); __set_size(__n); + __invalidate_iterators_past(__n); return *this; } @@ -2498,13 +2495,12 @@ size_type __sz = size(); __grow_by(__cap, __n - __cap, __sz, 0, __sz); } - else - __invalidate_iterators_past(__n); pointer __p = __get_pointer(); for (; __first != __last; ++__first, ++__p) traits_type::assign(*__p, *__first); traits_type::assign(*__p, value_type()); __set_size(__n); + __invalidate_iterators_past(__n); } else { diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-DEBUG-FIXME - // // template