diff options
author | Jason Merrill <jason@redhat.com> | 2023-06-05 23:58:32 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-06-06 21:30:00 -0400 |
commit | 0fa9495553e0e0f4ceb764880b5bdd8ade197382 (patch) | |
tree | aca36cafd1f8dd500890baac785a45898ff9715d /gcc/expr.cc | |
parent | 4fe84e2a4c0b600d2bc01f171b3b9dd1f4357208 (diff) | |
download | gcc-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