Fix for mismatch to handle evil iterators which overload operator comma
llvm-svn: 217903
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: bd7c7b55511a4b4b50b77559a44eff6d350224c4
diff --git a/include/algorithm b/include/algorithm
index 3ba104b..dbe888f 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -1140,7 +1140,7 @@
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _BinaryPredicate __pred)
{
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
@@ -1164,7 +1164,7 @@
_InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred)
{
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);