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



             Bug #: 56701

           Summary: The *this* pointer fails to bind to rvalue reference

                    to pointer type

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: gdjss2...@gmail.com





The following fails to compile with gcc 4.8.0:



struct A

{

  void f(){ A*&& a = this; }

};

int main(){}



Error messages:

error: invalid initialization of reference of type 'A*&&' from expression of

type 'A* const'

void f(){ A*&& a = this; }





According to 9.3.2p1, the this pointer is a prvalue of type A*, not A* const as

the error message suggests.

Reply via email to