From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Artem Khodush" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/3020: using operator-> within the class that defines it Date: Fri, 01 Jun 2001 03:36:00 -0000 Message-id: <20010601103600.14928.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00003.html List-Id: The following reply was made to PR c++/3020; it has been noted by GNATS. From: "Artem Khodush" To: Cc: , Subject: Re: c++/3020: using operator-> within the class that defines it Date: Fri, 1 Jun 2001 14:23:10 +0400 > When operator->() is defined within a class B, > gcc does not apply it to expressions of the form > "this->x" from within class B (although it has > no trouble when the expression is spelled out as > "this->operator()->x"). Not a bug. operator->() applies only to objects of the class, not to pointers to objects. You should write (*this)->x.