This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typename bug ?
- To: Miniussi <miniussi at ilog dot fr>
- Subject: Re: typename bug ?
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 27 Nov 1998 15:53:30 -0200
- Cc: egcs <egcs at cygnus dot com>
- References: <365E81A7.A2E017E3@ilog.fr>
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