-
Notifications
You must be signed in to change notification settings - Fork 7
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 A xvalue with its initial type "lvalue reference to cv T" #43
Comments
I agree the parameter copy doesn't work as intended for lvalue reference parameters. I disagree with your proposed resolution; I think we just want to carve out lvalue references and leave the rest alone. Note that those copies strip top-level cv-qualification from the declared types of the parameters. The "is never" phrasing refers to the fact that the parameter object created in the caller is never a const or volatile object, so the cv-stripping doesn't result in undefined behavior. |
The proposal trys to clarify how the
|
I guess we can carve all reference types and avoid saying the exact form of initialization for references.
Or...
|
This looks good to me. |
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[dcl.fct.def.coroutine] p13 says
How is such an xvalue produced if
T
is "lvalue reference to cv U"? Even though we didn't explicitly specify whether an expression of type "lvalue reference to object type" can be anxvalue
or not, anyway, from the convention and all rules defined in [expr], there is no such an xvalue. Basically, almost all of the expressions with "lvalue reference to object type" arelvalue
s.Suggested resolution:
This can make
xvalue
clear defined in this rule. Change [dcl.fct.def.coroutine.note] 2 toAn object denoted by an xvalue of cv-unqualified that type remains no change if it is a const or volatile object. "is never" sounds like this property would be changed after an xvalue denoting the object. The intent is that the object denoted by the xvalue should be a non-const non-volatile object in order to make the program be well-formed if any modification will be done through the xvalue.
This issue is also mentioned in cplusplus/draft#4870, but that issue did not clearly expound the thought.
The text was updated successfully, but these errors were encountered: