https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103185
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:fcc06cf83a9571a0745fcde83d955eb7d7f16910 commit r13-8248-gfcc06cf83a9571a0745fcde83d955eb7d7f16910 Author: Jason Merrill <ja...@redhat.com> Date: Tue Dec 19 16:12:02 2023 -0500 c++: xvalue array subscript [PR103185] Normally we handle xvalue array subscripting with ARRAY_REF, but in this case we weren't doing that because the operands were reversed. Handle that case better. PR c++/103185 gcc/cp/ChangeLog: * typeck.cc (cp_build_array_ref): Handle swapped operands. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/array-prvalue2.C: New test. * g++.dg/cpp1z/eval-order3.C: Test swapped operands. (cherry picked from commit 8dfc52a75d4d6c8be1c61b4aa831b1812b14a10e)