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: -pedantic and typedef inheritance.


> 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


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