diff options
author | Jason Merrill <jason@redhat.com> | 2022-02-02 18:36:41 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-02-05 00:56:05 -0500 |
commit | 119cea98f664764cce04963243c39c8f6d797d33 (patch) | |
tree | 1a19f7038ed4bbbf8733db6bf1d7d977068e6741 /gcc/gimple-expr.cc | |
parent | 0ef416e7edc4c66a06a3c05025720dfc98cf07f5 (diff) | |
download | gcc-119cea98f664764cce04963243c39c8f6d797d33.zip gcc-119cea98f664764cce04963243c39c8f6d797d33.tar.gz gcc-119cea98f664764cce04963243c39c8f6d797d33.tar.bz2 |
c++: assignment, aggregate, array [PR104300]
The PR92385 fix meant that we see more VEC_INIT_EXPR outside of INIT_EXPR;
in such cases, we need to wrap them in TARGET_EXPR. I previously fixed
that in build_array_copy; we also need it in process_init_constructor.
After fixing that, I needed to adjust a few places to recognize the
VEC_INIT_EXPR even inside a TARGET_EXPR. And prevent cp_fully_fold_init
from lowering VEC_INIT_EXPR too soon. And handle COMPOUND_EXPR inside
TARGET_EXPR better.
PR c++/104300
PR c++/92385
gcc/cp/ChangeLog:
* cp-tree.h (get_vec_init_expr): New.
(target_expr_needs_replace): New.
* cp-gimplify.cc (cp_gimplify_init_expr): Use it.
(struct cp_fold_data): New.
(cp_fold_r): Only genericize inits at end of fn.
(cp_fold_function): Here.
(cp_fully_fold_init): Not here.
* init.cc (build_vec_init): Use get_vec_init_expr.
* tree.cc (build_vec_init_expr): Likewise.
* typeck2.cc (split_nonconstant_init_1): Likewise.
(process_init_constructor): Wrap VEC_INIT_EXPR in
TARGET_EXPR.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/initlist-array14.C: New test.
Diffstat (limited to 'gcc/gimple-expr.cc')
0 files changed, 0 insertions, 0 deletions