https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124927
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:e793b563ef52f5442d97695a50027c7e62f31da0 commit r16-8783-ge793b563ef52f5442d97695a50027c7e62f31da0 Author: Jakub Jelinek <[email protected]> Date: Tue Apr 21 18:31:36 2026 +0200 c++: Fix up iterating expansion stmt b and e var handling [PR124927] The following testcase ICEs, because the TARGET_EXPR it had has VOID_TYPE TARGET_EXPR_INITIAL and force_target_expr obviously ICEs when trying to create a VOID_TYPE TARGET_EXPR. This patch fixes it by taking the cv_unqualified type of the TARGET_EXPRs before we extract their TARGET_EXPR_INITIAL, so it does the desirable thing of recreating the TARGET_EXPRs with cv unqualified types. 2026-04-21 Jakub Jelinek <[email protected]> PR c++/124927 * pt.cc (finish_expansion_stmt): Compute types for force_target_expr from b and e before extracting TARGET_EXPR_INITIAL from it. * g++.dg/cpp26/expansion-stmt41.C: New test. Reviewed-by: Jason Merrill <[email protected]>
