coroutines: Add cleanups, where required, to statements with captured references.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 8 Apr 2020 07:15:00 +0000 (08:15 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 9 Apr 2020 07:25:52 +0000 (08:25 +0100)
commit926d39c3816772acde857a8510480d9b287ef760
treed155c3ca3048e6ce560bb21d00b498019be285db
parentfe1837143f1bf1d6b072a3973b00576ee17c30a9
coroutines: Add cleanups, where required, to statements with captured references.

When we promote captured temporaries to local variables, we also
remove their initializers from the relevant call expression.  This
means that we should recompute the need for a cleanup expression
once the set of temporaries that remains becomes known.

gcc/cp/ChangeLog:

2020-04-08  Iain Sandoe  <iain@sandoe.co.uk>
    Jun Ma  <JunMa@linux.alibaba.com>

* coroutines.cc (maybe_promote_captured_temps): Add a
cleanup expression, if needed, to any call from which
we promoted temporaries captured by reference.
gcc/cp/ChangeLog
gcc/cp/coroutines.cc