This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strange behavior


Jimen Ching writes:

> You cut off the sentence where I said g++ did not warn about a typename.
> I've already tried typename, and it didn't work either.

Which version of egcs, on which platform?  Both 1.0.1 and the latest
snapshot compile that fine for me, even without typename (which, IMHO,
is wrong)

> But my point was that g++ didn't warn about typename and gave an
> error instead.  A parse error at that.  You would think that a
> missing typename would be a semantic error, not a parse error.

Nope, the `typename' keyword is required to tell the parser that what
follows is a type name, not a static member variable or function.  The
C++ Standard states that, if a template-argument-dependent qualified
name is not preceded by the `typename' keyword, it is not to be
considered a type name.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]