https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117520
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:17ff72651dbba6790ce4c492aa2df78f1dbdaf3e commit r14-10919-g17ff72651dbba6790ce4c492aa2df78f1dbdaf3e Author: Jonathan Wakely <jwak...@redhat.com> Date: Mon Nov 11 11:54:00 2024 +0000 libstdc++: Fix typos in iterator increment for std::text_encoding [PR117520] The intended behaviour for std::text_encoding::aliases_view's iterator is that it incrementing or decrementing too far sets it to a value-initialized state, or fails an assertion when those are enabled. There were typos that used == instead of = which meant that instead of becoming singular or aborting, an out-of-range increment just did nothing. This meant erroneous operations were well-defined and didn't produce any undefined behaviour, but were not diagnosed with assertions enabled, as had been intended. This change fixes the bugs and adds more tests to verify the intended behaviour. libstdc++-v3/ChangeLog: PR libstdc++/117520 * include/std/text_encoding (aliases_view:_Iterator::operator+=): Fix typos that caused == to be used instead of =. (aliases_view::_Iterator): Fix friend declaration. * testsuite/std/text_encoding/members.cc: Adjust expected behaviour of invalid subscript. Add tests for other erroneous operations on iterators.