This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -pedantic and typedef inheritance.
- To: goof at dsp dot sun dot ac dot za
- Subject: Re: -pedantic and typedef inheritance.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 8 Jan 2000 13:22:14 +0100
- CC: oliva at lsd dot ic dot unicamp dot br, gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10001081320340.23423-100000@pablo.dsp.sun.ac.za>
> 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).
The qualification is required for all members of the base. g++
enforces this rules for types with -pedantic, but doesn't for data
members. This is a bug in g++, which is partially caused by the fact
that the dependent/non-dependent names distinction is not implemented
correctly.
>
> 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.
Please have a look at 14.6.2, [temp.dep]/3. An example for non-type
members is given in [temp.dep]/4. The issue is that detecting
dependent names is merely syntactical, and that you can't know what
members the base type contains until you know the template arguments
for the base type (because it might be a specialization).
Regards,
Martin