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]

Re: c++/3020: using operator-> within the class that defines it


> 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.



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