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++ bug 764


>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:

> |      *p == *p; // error

> At this point, we need to instantiate the class S<int> in order to
> form the overload set.  See 13.3.1.2/3.

I agree.  This should be easy enough to fix.

>>>>> "Martin" == Martin Sebor <sebor@roguewave.com> writes:

> As for the warning, I believe that while it may be useful to novices it
> shouldn't be issued unless explicitly requested (e.g., as a remark).
> Even then I'm not sure it's the best idea for a compiler to give
> "helpful" hints on how to "improve" one's code, especially if the code
> is perfectly correct.

I agree that the warning should not be issued for this testcase, because
the friend function is defined in the class body.  But I still think it
should be issued by default when that is not the case.  It's not just
novices this is useful for; old hands at C++ get tripped up by this as
well, as it's a significant recent change in the language.  I see bug
reports about this all the time, even with the warning.

Jason


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