https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118574

--- Comment #19 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #17)
> Note, even the D {} temporary goes into function local vars rather than in
> the narrower scope.

hmm.  This might be an underlying problem, the coroutines code wants to be able
to reason about the lifetime of variables that must exist across an await
expression.

> So, can coro handle even such temporaries which didn't have pushdecl called
> on them, or would we need to somehow find out all such temporaries and call
> pushdecl on them at some point?

It should be able to - temporaries are 'promoted' when they exist within a
cleanup point statement/expression and that statement/expression contains an
await expression.

so cleanup point statements should be morphed into a BIND_EXPR with the
temporaries given a compiler-local names and contained in the BIND_EXPR_VARS. 
The latter step is what causes them to be preserved in the frame.

Reply via email to