]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: -frange-for-ext-temps and reused temps [PR118856]
authorJason Merrill <jason@redhat.com>
Thu, 13 Feb 2025 10:54:48 +0000 (11:54 +0100)
committerJason Merrill <jason@redhat.com>
Thu, 13 Feb 2025 15:58:30 +0000 (16:58 +0100)
commit6f7935b3fd60968cff1b3252edf40022f25705aa
tree56ce0fec217424c711c8e1cf4f722a33990ff63e
parent84f19ecb01958fa791b9213dbd80331474fca9f0
c++: -frange-for-ext-temps and reused temps [PR118856]

Some things in the front-end use a TARGET_EXPR to create a temporary, then
refer to its TARGET_EXPR_SLOT separately later; in this testcase,
maybe_init_list_as_range does.  So we need to handle that pattern in
extend_all_temps.

PR c++/118856

gcc/cp/ChangeLog:

* call.cc (struct extend_temps_data): Add var_map.
(extend_all_temps): Adjust.
(set_up_extended_ref_temp): Make walk_data void*.
(extend_temps_r): Remap variables.  Handle pset here.
Extend all TARGET_EXPRs.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/range-for9.C: New test.
gcc/cp/call.cc
gcc/testsuite/g++.dg/cpp23/range-for9.C [new file with mode: 0644]