From 60afb4386d19f17d11b183868eb32da06e7fa3eb Mon Sep 17 00:00:00 2001 From: Adrian McCarthy Date: Fri, 5 May 2017 17:14:00 +0000 Subject: [PATCH] Allow operator-> to work from a FixedStreamArrayIterator. This is similar to my recent fix for VarStreamArrayIterator, but the cause (and thus the fix) is subtley different. The FixedStreamArrayIterator iterates over a const Array, so the iterator's value type must be const. llvm-svn: 302257 --- llvm/include/llvm/Support/BinaryStreamArray.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h index c36e5da..b25c03a 100644 --- a/llvm/include/llvm/Support/BinaryStreamArray.h +++ b/llvm/include/llvm/Support/BinaryStreamArray.h @@ -342,7 +342,7 @@ private: template class FixedStreamArrayIterator : public iterator_facade_base, - std::random_access_iterator_tag, T> { + std::random_access_iterator_tag, const T> { public: FixedStreamArrayIterator(const FixedStreamArray &Array, uint32_t Index) @@ -356,6 +356,7 @@ public: } const T &operator*() const { return Array[Index]; } + const T &operator*() { return Array[Index]; } bool operator==(const FixedStreamArrayIterator &R) const { assert(Array == R.Array); -- 2.7.4