OSDN Git Service

Merge remote-tracking branch 'gnu/gcc-4_7-branch' into rework
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / bits / stl_algo.h
index a292150..a7b3ef4 100644 (file)
@@ -1865,7 +1865,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          for (; __first != __last; ++__first)
            if (__pred(*__first))
              {
-               *__result1 = _GLIBCXX_MOVE(*__first);
+               if (__result1 != __first)
+                 *__result1 = _GLIBCXX_MOVE(*__first);
                ++__result1;
              }
            else