https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118923
--- Comment #7 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:a41b3f54c13890b1327bb3d4fbae8f7feb37d00b commit r15-7690-ga41b3f54c13890b1327bb3d4fbae8f7feb37d00b Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Feb 25 09:26:46 2025 +0100 c++: Fix range for with PMFs [PR118923] The following testcases segfault because the new range for -frange-for-ext-temps temporary extension extends even the internal TARGET_EXPRs created by get_member_function_from_ptrfunc. The following patch fixes that by using get_internal_target_expr for those instead of force_target_expr (similarly in cp_finish_decl and build_comparison_op) and using force_target_expr inside of get_internal_target_expr. 2025-02-25 Jakub Jelinek <ja...@redhat.com> PR c++/118923 * tree.cc (get_internal_target_expr): Use force_target_expr instead of build_target_expr_with_type. * typeck.cc (get_member_function_from_ptrfunc): Use get_internal_target_expr instead of force_target_expr. * decl.cc (cp_finish_decl): Likewise. * method.cc (build_comparison_op): Likewise. * g++.dg/cpp0x/pr118923.C: New test. * g++.dg/cpp1y/pr118923.C: New test.