https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112491
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:5d6f62c9b2377b9b4c5b8c2eb1a6bcf00ba8ab2c commit r13-8072-g5d6f62c9b2377b9b4c5b8c2eb1a6bcf00ba8ab2c Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Nov 14 15:08:13 2023 +0000 libstdc++: Fix std::deque::operator[] Xmethod [PR112491] The Xmethod for std::deque::operator[] has the same bug that I recently fixed for the std::deque::size() Xmethod. The first node might have unused capacity at the start, which needs to be accounted for when indexing into the deque. libstdc++-v3/ChangeLog: PR libstdc++/112491 * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index): Correctly handle unused capacity at the start of the first node. * testsuite/libstdc++-xmethods/deque.cc: Check index operator when elements have been removed from the front. (cherry picked from commit 452476db0c705caeac8712d560fc16ced0ca5226)