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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |c++-coroutines
          Component|tree-optimization           |c++

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
```
coro1
my_coro (int v1, int& v2, int&& v3)
{
  co_yield v1 + v2 + v3;
  co_return v1 + v2 + v3;
}

int main ()
{
  PRINT ("main: create coro1");
  int lv = 1;
  int lvr = 2;
  coro1 x = my_coro (lv, lvr, lvr+2);

```

v3 here is a temporary reference which does not get extended.

I don't know the rules for coroutines if the co-rountine keeps around the
rvalue reference or is that just undefined?

The problem is NOT a tree optimization issue as far as I can tell.

Reply via email to