summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2017-10-30 15:50:00 +0000
committerMarshall Clow <mclow.lists@gmail.com>2017-10-30 15:50:00 +0000
commit05da5b0205aeada52a6838353d214db3723c79c7 (patch)
tree2cc8e56888649ff4c4938cd9f475e40bdd6979c7 /libcxx/include/algorithm
parent4e13d4de52783dbdf9268a01055b546f5176947c (diff)
downloadbcm5719-llvm-05da5b0205aeada52a6838353d214db3723c79c7.tar.gz
bcm5719-llvm-05da5b0205aeada52a6838353d214db3723c79c7.zip
Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix.
llvm-svn: 316914
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 282083a89c2..f5776b40400 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -5547,9 +5547,9 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
}
else
{
- *__result = *__first1;
if (!__comp(*__first1, *__first2))
++__first2;
+ *__result = *__first1;
++__first1;
}
}
OpenPOWER on IntegriCloud