Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-10-30 15:50:00 +00:00
parent 9bc42cf1d7
commit c3fa9655a4
2 changed files with 45 additions and 1 deletions

View File

@@ -5547,9 +5547,9 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
}
else
{
*__result = *__first1;
if (!__comp(*__first1, *__first2))
++__first2;
*__result = *__first1;
++__first1;
}
}