This is the mail archive of the gcc@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: typename bug ?


On Nov 27, 1998, Miniussi <miniussi@ilog.fr> wrote:

> I have some problems with typename, and I m not sure if the
> problem is with egcs or with my understanding of the standard:

> since the names declared in A<T> are not suppose to be 
> considered until instanciation os B<int>, it seems that a typename
> is missing

Nope.  `typename' can only precede qualified names.  You should write
`typename A<T>::ptr'

> (HP aCC 1.15 flags (1) as an error, but Dec cxx 6.1 does not)

The code is correct, as long as `ptr' is found to be a type at
template instantiation time.

> Moreover, if you uncoment (3), the program compiles without problem

Which is correct.  The name is found a template parse time, so it is
not considered a dependent name, and is bound before instantiation.

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
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]