This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: C++ bug 764
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: Re: C++ bug 764
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 14 May 2001 00:40:01 +0200
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com, sebor at roguewave dot com
- References: <3AF29153.935B582@codesourcery.com><fl66fd8lg3.fsf@sel.cmla.ens-cachan.fr>
>>>>> "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