From: Benjamin Kosnik Date: Fri, 6 Apr 2001 22:21:29 +0000 (+0000) Subject: stl_algobase.h (std::equal): avoid use of possibly-undefined operator != (one line... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=14bc1c0e15633ea781d76d0ae4274b2e27d51db5;p=gcc.git stl_algobase.h (std::equal): avoid use of possibly-undefined operator != (one line patch). 2001-04-06 Joe Buck * stl_algobase.h (std::equal): avoid use of possibly-undefined operator != (one line patch). From-SVN: r41170 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2120684021f..7cb30669680 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2001-04-06 Gabriel Dos Reis + + * testsuite/25_algorithms/equal.cc: New test. + +2001-04-06 Joe Buck + + * stl_algobase.h (std::equal): avoid use of possibly-undefined + operator != (one line patch). + 2001-04-06 Benjamin Kosnik * include/backward/backward_warning.h: Re-enable. diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index df768c615ff..29bc953d610 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -540,7 +540,7 @@ inline bool equal(_InputIter1 __first1, _InputIter1 __last1, typename iterator_traits<_InputIter2>::value_type>); for ( ; __first1 != __last1; ++__first1, ++__first2) - if (*__first1 != *__first2) + if (!(*__first1 == *__first2)) return false; return true; }