[C++ PATCH for 3.3] Fix implicit typename warning regression

Jason Merrill jason@redhat.com
Fri Jun 6 17:44:00 GMT 2003


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



More information about the Gcc-patches mailing list