Annoying bug in g++ current (egcs-2.92.04 19980914) frontend

Alexandre Oliva oliva@dcc.unicamp.br
Sun Sep 20 01:15:00 GMT 1998


Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:

>> template <class T> class B { typedef T Real; };
>> template <class Real> class A : B<Real> { typedef Real type; };

>> It works fine with the 1.1 release. Am I wrong to consider this a bug?

> Yes. According to 14.6.1, [temp.local]/4, your example is ill-formed:

But he isn't redeclaring the name Real within the template class, it's
just creating an alias to it.  Furthermore, since the base class
B<Real> depends on a template argument, [temp.local]/7 does not apply, 
`B<Real>::Real' does not override the template argument, so creating
an alias to that type should be fine.

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