diff options
author | Jason Merrill <jason@redhat.com> | 2025-04-07 11:49:19 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-04-07 13:04:34 -0400 |
commit | c7dc9b6f889fa8f9e4ef060c3af107eaf54265c5 (patch) | |
tree | 6899780475998ea9a0397d920c611ee843576737 /gcc/rust/resolve | |
parent | 3a77a567b1028a28ecbb2f2eadc351d8bd004352 (diff) | |
download | gcc-c7dc9b6f889fa8f9e4ef060c3af107eaf54265c5.zip gcc-c7dc9b6f889fa8f9e4ef060c3af107eaf54265c5.tar.gz gcc-c7dc9b6f889fa8f9e4ef060c3af107eaf54265c5.tar.bz2 |
c++: constinit and value-initialization [PR119652]
Value-initialization built an AGGR_INIT_EXPR to set AGGR_INIT_ZERO_FIRST on.
Passing that AGGR_INIT_EXPR to maybe_constant_value returned a TARGET_EXPR,
which potential_constant_expression_1 mistook for a temporary.
We shouldn't add a TARGET_EXPR to the AGGR_INIT_EXPR in this case, just like
we already avoid adding it to CONSTRUCTOR or CALL_EXPR.
PR c++/119652
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_outermost_constant_expr): Also don't add a
TARGET_EXPR around AGGR_INIT_EXPR.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constinit20.C: New test.
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions