Skip to content

[dcl.fct.def.coroutine]: Initialization of the copy of a parameter of a coroutine #7383

Open
@RazvanAM

Description

@RazvanAM

[dcl.fct.def.coroutine] paragraph 13 states the following:

When a coroutine is invoked, after initializing its parameters ([expr.call]), a copy is created for each coroutine parameter. For a parameter of type cv T, the copy is a variable of type cv T with automatic storage duration that is direct-initialized from an xvalue of type T referring to the parameter. [...]

Considering the following coroutine:

task<void> f(int& p)
{
   ...
}

the copy of the parameter p has type int& and it is initialized with an xvalue, which should not be legal.

Is there something else that I might be missing?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions