This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: template with member and friend function having the same name
- To: yelistratov at gmd dot de
- Subject: Re: template with member and friend function having the same name
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 23 Mar 2000 00:32:43 +0100
- CC: gcc at gcc dot gnu dot org
- References: <38D8C8C1.EAFF8557@gmd.de>
> Is it really true that member and friend functions of a template can
> not have the same name?
Depends on what you mean by 'name'. If you are talking about qualified
names, they *never* have the same name: the methods are qualified by
their class; the friends are qualified by their namespace (unless the
friends are also methods).
> Will be the bug for theoretically correct definition
> friend A<T> ::operator- <> (const T, const A<T>&);
> fixed in next releases of gcc?
So far, it has not been fixed, and no effort is currently being made
to fix it. Essentially, you would have to rewrite the C++ parser from
scratch, and nobody has volunteered to do so. Please have a look at
http://gcc.gnu.org/cgi-bin/fom.cgi?file=12
Perhaps GMD (or Fraunhofer) would be willing to fund such a project?
:-)
Regards,
Martin