diff --git a/libcxx/include/__tree b/libcxx/include/__tree index 247a5acfb148..bbf7c71962e9 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -1411,8 +1411,9 @@ void __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _ __cache.__advance(); } } + const_iterator __e = end(); for (; __first != __last; ++__first) - __insert_multi(_NodeTypes::__get_value(*__first)); + __insert_multi(__e, _NodeTypes::__get_value(*__first)); } template