This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: implicit typename deprecated, "see documentation"
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Paul Koning <pkoning at equallogic dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 11 Jun 2003 15:11:35 -0300
- Subject: Re: implicit typename deprecated, "see documentation"
- Organization: GCC Team, Red Hat
- References: <16103.25899.63644.433806@pkoning.dev.equallogic.com>
On Jun 11, 2003, Paul Koning <pkoning@equallogic.com> wrote:
> filename.hh:556: warning: implicit typename is deprecated, please see the documentation for details
> Ok, so what does this mean?
It means your program is not written in ISO C++, and GCC is moving
towards enforcing a rule that it used to be more lenient about.
> And what documentation am I supposed to refer to for details?
The ISO C++ Standard.
The rule is that, if a qualified name is template-dependent, it must
be preceded by the `typename' keyword.
template <typename T>
class foo {
T x; // unqualified, but T is known to be a typename, so ok
T::bar y; // ill-formed, qualified template-dependent not preceded
// by typename must be assumed to not be a type name
typename T::bar z; // ok, as long as T::bar turns out to be a type
};
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer