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] p13 "xvalue of type T" where T is lvalue reference type #4870

Open
xmh0511 opened this issue Sep 6, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Sep 6, 2021

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.

Since [expr.type] p1 says

If an expression initially has the type “reference to T” ([dcl.ref], [dcl.init.ref]), the type is adjusted to T prior to any further analysis.

When we say xvalue, the type of it should be a non-reference type. However, in [dcl.fct.def.coroutine] p13, T could be any type such as "lvalue reference type". How could an expression be an xvalue when it has an lvalue reference type? Regardless of [expr.type] p1 or a xvalue of lvalue reference type, [dcl.fct.def.coroutine] p13 conflict with both of them.

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

1 participant