Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RazvanAM opened this issue Nov 12, 2024 · 2 comments

Comments

@RazvanAM
Copy link

[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!

@xmh0511
Copy link
Contributor

xmh0511 commented Nov 18, 2024

See cplusplus/CWG#43

@RazvanAM
Copy link
Author

I see, so the issue is already being discussed. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants