diff options
author | Jason Merrill <jason@redhat.com> | 2025-06-04 13:31:02 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-06-09 09:22:07 -0400 |
commit | 4e4684ca6a79b22fe91acaa81af2d4a00d6e1345 (patch) | |
tree | 7f6253a47f2102426724d80563ae73d71517d850 /gcc/tree-if-conv.c | |
parent | d96603a48d338a92b78628016d00cbf11576621e (diff) | |
download | gcc-4e4684ca6a79b22fe91acaa81af2d4a00d6e1345.zip gcc-4e4684ca6a79b22fe91acaa81af2d4a00d6e1345.tar.gz gcc-4e4684ca6a79b22fe91acaa81af2d4a00d6e1345.tar.bz2 |
c++: constexpr prvalues vs genericize [PR120502]
Here constexpr evaluation was getting confused by the result of
split_nonconstant_init, which leaves an INIT_EXPR from an empty CONSTRUCTOR
to be followed by member initialization. As a result
CONSTRUCTOR_NO_CLEARING was set for the time_zone, and
cxx_eval_store_expression didn't set it again for the initial clobber in the
basic_string constructor, so when cxx_fold_indirect_ref wants to check
whether the anonymous union active member had type non_trivial_if, we see
that we don't currently have a value for the anonymous union, try to add
one, and fail.
So let's do constexpr evaluation before split_nonconstant_init.
PR c++/120502
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Do constexpr evaluation
before genericize.
* constexpr.cc (cxx_eval_store_expression): Add comment.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constexpr-prvalue2.C: New test.
Diffstat (limited to 'gcc/tree-if-conv.c')
0 files changed, 0 insertions, 0 deletions