aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-07-27 09:10:07 -0400
committerPatrick Palka <ppalka@redhat.com>2023-07-27 09:10:07 -0400
commita426b91b27e28985f47d16827a532fbc28c09bd7 (patch)
tree49241c41c1efce77480b4ae913e5acee20d0ed93 /gcc/expr.cc
parent33b153ff521e2f33acf7d076f8625d85319b731d (diff)
downloadgcc-a426b91b27e28985f47d16827a532fbc28c09bd7.zip
gcc-a426b91b27e28985f47d16827a532fbc28c09bd7.tar.gz
gcc-a426b91b27e28985f47d16827a532fbc28c09bd7.tar.bz2
c++: constexpr empty subobject elision [PR110197]
Now that init_subob_ctx no longer sets new_ctx.ctor for a subobject of empty type, it seems we need to ensure its callers also consistently omit entries in the parent ctx->ctor for such subobjects. We also need to allow cxx_eval_array_reference to synthesize an empty subobject even if the array CONSTRUCTOR has CONSTRUCTOR_NO_CLEARING set. PR c++/110197 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an empty subobject even if CONSTRUCTOR_NO_CLEARING is set. (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx, i.e. whenever initializing an subobject of empty type. (cxx_eval_vec_init_1): Define 'no_slot' as above and use it accordingly. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-empty18.C: New test. * g++.dg/cpp0x/constexpr-empty19.C: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions