diff options
author | Adrian McCarthy <amccarth@google.com> | 2017-05-05 17:14:00 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2017-05-05 17:14:00 +0000 |
commit | 60afb4386d19f17d11b183868eb32da06e7fa3eb (patch) | |
tree | c49924a4fd35d88b7dbabb66f554afece4e16a5a | |
parent | fc481e5eb71237421f189951b9d383f72bd63bf1 (diff) | |
download | bcm5719-llvm-60afb4386d19f17d11b183868eb32da06e7fa3eb.tar.gz bcm5719-llvm-60afb4386d19f17d11b183868eb32da06e7fa3eb.zip |
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
-rw-r--r-- | llvm/include/llvm/Support/BinaryStreamArray.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h index c36e5da72d5..b25c03a95c0 100644 --- a/llvm/include/llvm/Support/BinaryStreamArray.h +++ b/llvm/include/llvm/Support/BinaryStreamArray.h @@ -342,7 +342,7 @@ private: template <typename T> class FixedStreamArrayIterator : public iterator_facade_base<FixedStreamArrayIterator<T>, - std::random_access_iterator_tag, T> { + std::random_access_iterator_tag, const T> { public: FixedStreamArrayIterator(const FixedStreamArray<T> &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<T> &R) const { assert(Array == R.Array); |