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: 01 Dec 1998 12:14:02 -0200
- Cc: egcs <egcs at cygnus dot com>
- References: <365E81A7.A2E017E3@ilog.fr> <oriug1xbs5.fsf@araguaia.dcc.unicamp.br> <366271BF.9EE47A92@ilog.fr>
On Nov 30, 1998, Miniussi <miniussi@ilog.fr> wrote:
> Alexandre Oliva wrote:
>> 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'
> I know... let say that a typename A<T>:: is missing if you
> prefer.
It makes all the difference. Without `A<T>::', `ptr' is not a
qualified name, and then it needs not and, actually, must not be
preceded by `typename'. But then, it appears to me that it should not
be found by name lookup, and you're right, an error messages should be
printed.
>> > (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.
> Why is it correct?
It is not, I just thought it was :-)
I'm installing the following testcase in the testsuite.
type=text/plain filename="/home/msc/oliva/src/g++t/g++.pt/lookup6.C" description="g++.pt/lookup6.C">
--
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