This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH for 3.3] Fix implicit typename warning regression
- From: Jason Merrill <jason at redhat dot com>
- To: <lerdsuwa at users dot sourceforge dot net>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 06 Jun 2003 13:43:04 -0400
- Subject: Re: [C++ PATCH for 3.3] Fix implicit typename warning regression
- References: <Pine.LNX.4.33.0306062301400.20580-100000@localhost.localdomain>
On Fri, 6 Jun 2003 23:02:27 +0700 (ICT), Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> wrote:
> In GCC 3.3, we have a problem issuing warning for implicit
> typename. It affects friend class declaration like
>
> friend class T::X;
>
> where 'T' is template parameter dependent. The syntax forbids
> 'typename' keyword here so implicit typename warning should
> not apply. However GCC 3.3 outputs a warning for such code.
Agreed. But this is not because of the 'friend' syntax, but rather because
of the use of an elaborated-type-specifier, which implies 'typename'. See
DR 180.
> + template <typename U> friend struct Y::Z f(U); // { dg-warning "implicit" }
This should not give a warning, either, because of the use of 'struct'.
Jason