[libcxx] r217903 - Fix for mismatch to handle evil iterators which overload operator comma

Marshall Clow mclow.lists at gmail.com
Tue Sep 16 13:40:06 PDT 2014


Author: marshall
Date: Tue Sep 16 15:40:05 2014
New Revision: 217903

URL: http://llvm.org/viewvc/llvm-project?rev=217903&view=rev
Log:
Fix for mismatch to handle evil iterators which overload operator comma

Modified:
    libcxx/trunk/include/algorithm

Modified: libcxx/trunk/include/algorithm
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=217903&r1=217902&r2=217903&view=diff
==============================================================================
--- libcxx/trunk/include/algorithm (original)
+++ libcxx/trunk/include/algorithm Tue Sep 16 15:40:05 2014
@@ -1140,7 +1140,7 @@ pair<_InputIterator1, _InputIterator2>
 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 @@ mismatch(_InputIterator1 __first1, _Inpu
          _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);





More information about the cfe-commits mailing list