aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-06-05 23:58:32 -0400
committerJason Merrill <jason@redhat.com>2023-06-06 21:30:00 -0400
commit0fa9495553e0e0f4ceb764880b5bdd8ade197382 (patch)
treeaca36cafd1f8dd500890baac785a45898ff9715d /gcc/expr.cc
parent4fe84e2a4c0b600d2bc01f171b3b9dd1f4357208 (diff)
downloadgcc-0fa9495553e0e0f4ceb764880b5bdd8ade197382.zip
gcc-0fa9495553e0e0f4ceb764880b5bdd8ade197382.tar.gz
gcc-0fa9495553e0e0f4ceb764880b5bdd8ade197382.tar.bz2
c++: fix contracts with NRV
The NRV implementation was blindly replacing the operand of RETURN_EXPR, clobbering anything that check_return_expr might have added on to the actual initialization, such as checking the postcondition. gcc/cp/ChangeLog: * semantics.cc (finalize_nrv_r): [RETURN_EXPR]: Only replace the INIT_EXPR. gcc/testsuite/ChangeLog: * g++.dg/contracts/contracts-post7.C: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions