Fix wrong iterator type
authorRui Ueyama <ruiu@google.com>
Mon, 21 Apr 2014 23:00:42 +0000 (23:00 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 21 Apr 2014 23:00:42 +0000 (23:00 +0000)
ELFEntityIterator does not implement RandomAccessIterator. It does
not even implement BidirectionalIterator.

This patch fixes LLD build issue when compiled with MSVC2013 with
debug: MSVC's find_if checks if the start iterator is before the end
iterator in the sense of operator< if it declares implementing
RandomAccessIterator. If a class does not have operator<, it fails
to compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206825 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELF.h

index 2572a4e279c73d8b09d80f043c1dd94bb337e6d4..268b273f439a1a911b3d22d3dc962814e4cf6967 100644 (file)
@@ -60,7 +60,7 @@ public:
   public:
     typedef ptrdiff_t difference_type;
     typedef EntT value_type;
-    typedef std::random_access_iterator_tag iterator_category;
+    typedef std::forward_iterator_tag iterator_category;
     typedef value_type &reference;
     typedef value_type *pointer;