This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51406] [4.5/4.6/4.7 Regression][c++0x] Incorrect result of static_cast to rvalue reference to base class.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Dec 2011 15:26:07 +0000
- Subject: [Bug c++/51406] [4.5/4.6/4.7 Regression][c++0x] Incorrect result of static_cast to rvalue reference to base class.
- Auto-submitted: auto-generated
- References: <bug-51406-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51406
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-04 15:26:07 UTC ---
the conversions create unnecessary temporaries
int&& a = static_cast<A&&>(x).a;
int&& b = static_cast<B&&>(x).b;
std::cout<<"a="<<&a<<", b="<<&b<<std::endl;
shows they have the same address