[cfe-commits] r67999 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaOverload.cpp lib/Sema/SemaOverload.h test/SemaCXX/rval-references.cpp
sebastian.redl at getdesigned.at
Wed Apr 1 14:14:19 CDT 2009
Howard Hinnant wrote:
> Using g++-4.4 -std=c++0x I'm seeing an extraneous warning on this test
> #include <assert.h>
> g(int&& i)
> return static_cast<int&&>(i); // line 6
> int main()
> int i = g(2);
> assert(i == 2);
> test.cpp:6: warning: returning reference to temporary
> And I thought that the mistake may be common enough to catch clang as
> well, so I'm mentioning it here.
I'll add a test case.
> This is probably getting into an area recently described to me by
> Mike Miller (EDG) as "funny rvalues". When you bind an rvalue
> reference to an rvalue, that rvalue now has some properties, such as
> identity that are new to rvalues. CWG issue 664 is also working this
I believe issue 664 is moot now that rvalue refs cannot bind to lvalues.
More information about the cfe-commits