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

[expr.ref]/2 #2051

Closed
jabelloc opened this issue Apr 26, 2018 · 2 comments
Closed

[expr.ref]/2 #2051

jabelloc opened this issue Apr 26, 2018 · 2 comments

Comments

@jabelloc
Copy link

[expr.ref]/2

For the first option (dot) the first expression shall be a glvalue having class type. . . .

We should replace the "glvalue having class type" above by "glvalue or prvalue having class type", otherwise the snippet below would be invalid.

struct A{ int a; };
int&& r = A().a;
@tkoeppe
Copy link
Contributor

tkoeppe commented Apr 26, 2018

No, prvalues aren't materialized objects. We really do want a glvalue here, and that will necessitate materialization [conv.rval].

@tkoeppe tkoeppe closed this as completed Apr 26, 2018
@jabelloc
Copy link
Author

jabelloc commented Apr 26, 2018

No, prvalues aren't materialized objects. We really do want a glvalue here, and that will necessitate materialization [conv.rval].

That doesn't make any sense to me It would be much easier to understand what you said with something like this: For the first option (dot) the compiler requires a glvalue. But it will implicitly convert a prvalue into an xvalue by [conv.rval].

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