This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -pedantic and typedef inheritance.
- To: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Subject: Re: -pedantic and typedef inheritance.
- From: Gerhard Esterhuizen <goof at dsp dot sun dot ac dot za>
- Date: Sat, 8 Jan 2000 13:26:55 +0200 (SAST)
- cc: gcc at gcc dot gnu dot org
On 8 Jan 2000, Alexandre Oliva wrote:
> 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;
>
Thanks for the response. I still don't quite get it. Is the qualification
required (according to ANSI/ISO) of all members (data, functions and
typdefs in the example) or just of the typedefs ? It seems that the data
members inherit (or is it just that no diagnostic is required).
I know this is not comp.c++.for.dummies. So if this is off-topic, I'll
appreciate a reference. I've got the ISO/ANSI C++ standard, but it is
still a bit foreign to me.
Gerhard Esterhuizen <gesterhuizen@bigfoot.com>
Digital Signal Processing
University of Stellenbosch
South Africa
+27-21-808-4315
"You will never be happy if you continue to search for what happiness
consists of.
You will never live if you are looking for the
meaning of life."
--Albert Camus
(1913 - 1960)