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.type.simple] erroneous example #60

Closed
sdutoit opened this issue Apr 15, 2013 · 0 comments
Closed

[dcl.type.simple] erroneous example #60

sdutoit opened this issue Apr 15, 2013 · 0 comments
Labels
tiny An issue with a small change; with "cwg" label: can be applied editorially after CWG consent.

Comments

@sdutoit
Copy link
Contributor

sdutoit commented Apr 15, 2013

From an email to cxxeditor@:

I just notice that the example in [dcl.type.simple]

const int&& foo();
int i;
[..]
decltype(foo()) x1 = i; // type is const int&&

looks erroneous. The defect is that you cannot initialize a variable
"const int&&" with an lvalue of int (as shown here). A possible fix
would be to write this as:

const int&& foo();
[..]
decltype(foo()) x1 = 0; // type is const int&&

(this is: Including a strike of the variable 'i').

My understanding is that this is an editorial defect, because

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#651

already suggested a fix of the examples here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tiny An issue with a small change; with "cwg" label: can be applied editorially after CWG consent.
Projects
None yet
Development

No branches or pull requests

1 participant