[llvm] r206825 - Fix wrong iterator type

Rui Ueyama ruiu at google.com
Mon Apr 21 16:00:43 PDT 2014

Author: ruiu
Date: Mon Apr 21 18:00:42 2014
New Revision: 206825

URL: http://llvm.org/viewvc/llvm-project?rev=206825&view=rev
Fix wrong iterator type

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.


Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=206825&r1=206824&r2=206825&view=diff
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Mon Apr 21 18:00:42 2014
@@ -60,7 +60,7 @@ 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;

More information about the llvm-commits mailing list