aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-array-bounds.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-07-25 11:13:31 -0400
committerJason Merrill <jason@redhat.com>2022-07-25 20:06:37 -0400
commit789c4b9bb015c361bc1a6adfcd0abadce555e562 (patch)
treebb5dc941642a5255063a67d9c777cb9828ca4e8a /gcc/gimple-array-bounds.cc
parenta6efab5fbc468b6f98a7522295b7991d2036588b (diff)
downloadgcc-789c4b9bb015c361bc1a6adfcd0abadce555e562.zip
gcc-789c4b9bb015c361bc1a6adfcd0abadce555e562.tar.gz
gcc-789c4b9bb015c361bc1a6adfcd0abadce555e562.tar.bz2
c++: aggregate prvalue as for range [PR106230]
Since my PR94041 work on temporary lifetime in aggregate initialization, we end up calling build_vec_init to initialize the reference-extended temporary for the artificial __for_range variable. And build_vec_init uses finish_for_stmt to implement its loop. That function assumes that if __for_range is in current_binding_level, we're finishing a range-for, and we should fix up the variable as it goes out of scope. But when called from build_vec_init we aren't finishing a range-for, and do_poplevel doesn't remove the variable from scope because stmts_are_full_exprs_p is false. So let's check that here as well, and leave the DECL_NAME alone. PR c++/106230 gcc/cp/ChangeLog: * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/range-for38.C: New test.
Diffstat (limited to 'gcc/gimple-array-bounds.cc')
0 files changed, 0 insertions, 0 deletions