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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-03-20
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=53281
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
As I said in PR 53281 comment 5, I think we should stop talking about "passing
'const S' as 'this' argument, because it's a leaky abstraction, and inaccurate
(this should be a pointer S* not S).

With the patch there it says:

u.C: In member function 'void S::g() const':
u.C:6:18: error: cannot call non-const member function on object of type 'const
S' [-fpermissive]
     this->f (this);   // which 'this?'
                  ^
u.C:2:8: note:   in call to 'void S::f(const S*)'
   void f (const S*);
        ^
u.C:8:12: error: cannot call non-const member function on object of type 'const
S' [-fpermissive]
     f (this);         // ditto
            ^
u.C:2:8: note:   in call to 'void S::f(const S*)'
   void f (const S*);
        ^

Reply via email to