aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-05-19 12:24:33 -0400
committerJason Merrill <jason@redhat.com>2022-05-24 15:50:26 -0400
commit72f76540ad0e7185d4f516e781e8bead13ebc170 (patch)
tree843cb42d0a7025cb8cadc4432c64ba871a0e9587 /gcc/d/expr.cc
parent2540e2c604142889308857657d3510874955336a (diff)
downloadgcc-72f76540ad0e7185d4f516e781e8bead13ebc170.zip
gcc-72f76540ad0e7185d4f516e781e8bead13ebc170.tar.gz
gcc-72f76540ad0e7185d4f516e781e8bead13ebc170.tar.bz2
c++: discarded-value and constexpr
I've been thinking for a while that the 'lval' parameter needed a third value for discarded-value expressions; most importantly, cxx_eval_store_expression does extra work for an lvalue result, and we also don't want to do the l->r conversion. Mostly this is pretty mechanical. Apart from the _store_ fix, I also use vc_discard for substatements of a STATEMENT_LIST other than a stmt-expr result, and avoid building _REFs to be ignored in a few other places. gcc/cp/ChangeLog: * constexpr.cc (enum value_cat): New. Change all 'lval' parameters from int to value_cat. Change most false to vc_prvalue, most true to vc_glvalue, cases where the return value is ignored to vc_discard. (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result. (cxx_eval_store_expression): Only build _REF for vc_glvalue. (cxx_eval_array_reference, cxx_eval_component_reference) (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions