Strange behavior

Alexandre Oliva oliva@dcc.unicamp.br
Sun Mar 1 16:28:00 GMT 1998


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



More information about the Gcc-bugs mailing list