]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Allow NVRO in more cases for ramp functions.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 10 May 2025 16:22:55 +0000 (17:22 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 29 Jul 2025 15:01:31 +0000 (16:01 +0100)
commit491b8b29ff58353fa840b08087a9151c650a2ef8
tree40af81de86f7370c605668a1d1d5e691c18a6470
parent868a11b2f9a874071112f43cacdd65d5d399c26a
c++, coroutines: Allow NVRO in more cases for ramp functions.

The constraints of the c++ coroutines specification require the ramp
to construct a return object early in the function.  This will be returned
at some later time.  This is implemented as NVRO but requires that copying
be well-formed even though it will be elided.  Special-case ramp functions
to allow this.

gcc/cp/ChangeLog:

* typeck.cc (check_return_expr): Suppress conversions for NVRO
in coroutine ramp functions.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit d87caa9d3595ca845c9282cef8b0c9a656d8def0)
gcc/cp/typeck.cc