diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-03-05 16:07:37 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-03-05 16:07:37 +0000 |
| commit | 10b33a266258e1075a45df445f5b8f71b7ea514d (patch) | |
| tree | 6571328a131932493b685842bb8d115b1d766213 /libcxx | |
| parent | 8d0851f509bfd63180ba2d96c9028cb54b30c595 (diff) | |
| download | bcm5719-llvm-10b33a266258e1075a45df445f5b8f71b7ea514d.tar.gz bcm5719-llvm-10b33a266258e1075a45df445f5b8f71b7ea514d.zip | |
Rework reverse_iterator::operator[] so as not to use the base iterators operator [], which can cause constness problems. Fixes PR17883
llvm-svn: 231375
Diffstat (limited to 'libcxx')
| -rw-r--r-- | libcxx/include/iterator | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/iterator b/libcxx/include/iterator index 04ff4c127aa..7f7e9ee1933 100644 --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -575,7 +575,7 @@ public: _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;} _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const - {return current[-__n-1];} + {return *(*this + __n);} }; template <class _Iter1, class _Iter2> |

