http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51161

             Bug #: 51161
           Summary: [C++0x] Illegal static_cast to rvalue reference to
                    ambiguous base class
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ai.az...@gmail.com


Created attachment 25838
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25838
Outputs from -v option and preprocessed source.

According to N3291 (5.2.9/3), the following code is ill-formed. However, GCC
4.7-20111112 with -std=c++11 accepts it.


///////////////////////
struct A{};
struct B : A{};
struct C : A{};
struct D : B, C{};

int main()
{
  D d;
  static_cast<A &&>(d);
}
///////////////////////

Reply via email to