[cfe-dev] ElaboratedType, QualifiedNameType and TypenameType.

Abramo Bagnara abramo.bagnara at gmail.com
Mon Mar 22 15:15:36 PDT 2010


Il 22/03/2010 21:10, Douglas Gregor ha scritto:
> 
> 
> There is an option (C). Here's what I think each of the types should
> do:
> 
> ElaboratedType: Should handle all elaborated-type-specifiers in the
> C++0x sense, which means a type referenced via the
> enum/class/struct/union keyword. This class should be extended with
> an optional NestedNameSpecifier to handle qualified
> elaborated-type-specifiers, ideally in a implementation-detail base
> class so that we don't pay a size penalty for "struct X". Getting
> this right should make fixing PR5681 trivial.

Why don't have ElaboratedType of QualifiedNameType instead of optional NNS?

It seems to me it would be more congruent:

1) ElaboratedType of EnumType (for non qualified enum X)
2) ElaboratedType of QualifiedNameType of EnumType (for qualified not
dependent enum A::X)
3) ElaboratedType of TypenameType (for qualified dependent enum A::X)


> 
> QualifiedNameType: Should handle all type references that involve
> qualified names but for which we can resolve the name lookup to
> actually refer to a specific type. These could actually have
> "typename" qualifiers on them, but the point is that
> QualifiedNameType is always sugar.
> 
> TypenameType: Should handle all type references that involve
> qualified names where the name it refers to is a dependent name. May
> or may not actually have the "typename" keyword.



More information about the cfe-dev mailing list