[cfe-dev] ArrayType and qualifiers

Abramo Bagnara abramo.bagnara at gmail.com
Thu Jan 27 10:03:50 PST 2011


In recent clang versions while syntactically parsed ArrayTypes have
qualifiers in element type (congruently with the standard), canonical
ArrayTypes have qualifers *only* on array type.

I have two questions:

1) why element qualifiers are *moved* to ArrayType instead of to be
*propagated* to ArrayType? (i.e. qualifiers would be in both ArrayType
and element type)

2) considered that now calling getElementType() on a canonical ArrayType
returns the wrong result, how is possible to get the right element type
e.g. using TypeVisitor?

P.S. The way described in 1) would permit to have an AST congruent with
standard (i.e. the qualifiers in array would be a clang only thing and
the qualifiers in element type would be there to ensure standard
adherence). Of course it would solve also point 2) ;-)



More information about the cfe-dev mailing list