https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116113
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:295b729da5aa430a8c5df1422644159ca8bf8dcb commit r15-2645-g295b729da5aa430a8c5df1422644159ca8bf8dcb Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Aug 1 18:49:39 2024 +0200 c++: Fix up error recovery of invalid structured bindings used in conditions [PR116113] The following testcase ICEs, because for structured binding error recovery DECL_DECOMP_BASE is kept NULL and the newly added code to pick up saved value from the base assumes that on structured binding bases the TARGET_EXPR will be always there (that is the case if there are no errors). The following patch fixes it by testing DECL_DECOMP_BASE before dereferencing it, another option would be not to do that if error_operand_p (cond). 2024-08-01 Jakub Jelinek <ja...@redhat.com> PR c++/116113 * semantics.cc (maybe_convert_cond): Check DECL_DECOMP_BASE is non-NULL before dereferencing it. (finish_switch_cond): Likewise. * g++.dg/cpp26/decomp11.C: New test.