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++/69208] New: &*this should not be const-qualified


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.

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