This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -pedantic and typedef inheritance.
- To: Gerhard Esterhuizen <goof at dsp dot sun dot ac dot za>
- Subject: Re: -pedantic and typedef inheritance.
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Date: 08 Jan 2000 08:49:00 -0200
- Cc: gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10001081228410.23342-100000@pablo.dsp.sun.ac.za>
On Jan 8, 2000, Gerhard Esterhuizen <goof@dsp.sun.ac.za> wrote:
> I have a piece of code that contains a typedef in a templated base class
> that seems to inherit down to the the derived class depending on whether
> or not I use the -pedantic flag. Does this indicate that my code is wrong
> (non ANSI/ISO) or should I not use the pedantic flag ?
Your code is wrong, but it is accepted without -pedantic as an
extension. According to the C++ Standard, template-dependent base
classes are not examined during template parsing. Inherited members,
including typenames, must be qualified and prefixed by the `typename'
keyword:
typename Base3<Derived3<_TD>>::T_Generic t = 2;
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them