Closed
Description
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.