[Bug c++/69208] New: &*this should not be const-qualified

rs2740 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jan 9 09:33:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69208

            Bug ID: 69208
           Summary: &*this should not be const-qualified
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

Repro:

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

results in:

prog.cc: In member function 'void A::f()':
prog.cc:3:24: error: binding 'A* const' to reference of type 'A*&&' discards
qualifiers
   void f(){ A*&& a = &*this; }
                        ^~~~

PR56701 fixed the case where 'this' instead of '&*this' is used, but the above
test case still breaks.


More information about the Gcc-bugs mailing list