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 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

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