https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92472
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:4cbc9d8b346b932f34828a51e8822881413951b7 commit r11-179-g4cbc9d8b346b932f34828a51e8822881413951b7 Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu May 7 21:43:49 2020 +0100 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.