libstdc++: Make relational operators work with const guarded iterators (PR 92472)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 7 May 2020 20:43:49 +0000 (21:43 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 May 2020 20:43:49 +0000 (21:43 +0100)
commit4cbc9d8b346b932f34828a51e8822881413951b7
tree934e9347ab3a49342663d746ea67ba1524faa3d2
parentc7100843831147a034fe37d231c54ac53ceace45
libstdc++: Make relational operators work with const guarded iterators (PR 92472)

This is a correct fix for the incorrect cppcheck suggestion to make
these parameters const. In order to that, the dereference operators need
to be const. The conversions to the underlying iterator can be const
too.

PR c/92472
* include/parallel/multiway_merge.h (_GuardedIterator::operator*)
(_GuardedIterator::operator _RAIter, _UnguardedIterator::operator*)
(_UnguardedIterator::operator _RAIter): Add const qualifier.
(operator<(_GuardedIterator&, _GuardedIterator&)
(operator<=(_GuardedIterator&, _GuardedIterator&)
(operator<(_UnguardedIterator&, _UnguardedIterator&)
(operator<=(_UnguardedIterator&, _UnguardedIterator&): Change
parameters to const references.
libstdc++-v3/ChangeLog
libstdc++-v3/include/parallel/multiway_merge.h