The following function fails to compile with C++0x:
int main()
{
int i = 3;
int &&x = i;
}
$ g++ -std=gnu++0x test.cpp -o test
test.cpp:4:15: error: invalid initialization of reference of type 'int&&' from
expression of type 'int'
--
Summary: c++0x: Cannot init a R-value reference with L-value
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rodrigorivascosta at gmail dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43223