https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66742
--- Comment #19 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:1e7a269856fd67aff78ac874bec96d31a54b2fd9 commit r12-4873-g1e7a269856fd67aff78ac874bec96d31a54b2fd9 Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Nov 2 10:21:01 2021 +0000 libstdc++: Fix regression in std::list::sort [PR66742] The standard does not require const-correct comparisons in list::sort. libstdc++-v3/ChangeLog: PR libstdc++/66742 * include/bits/list.tcc (list::sort): Use mutable iterators for comparisons. * include/bits/stl_list.h (_Scratch_list::_Ptr_cmp): Likewise. * testsuite/23_containers/list/operations/66742.cc: Check non-const comparisons.