This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51406] [4.5/4.6/4.7 Regression][c++0x] Incorrect result of static_cast to rvalue reference to base class.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]