[cfe-dev] Syntactic order of CXXBaseOrMemberInitializers

Douglas Gregor dgregor at apple.com
Thu May 20 09:52:34 PDT 2010



Sent from my iPhone

On May 19, 2010, at 4:40 AM, Abramo Bagnara <abramo.bagnara at gmail.com> wrote:

> 
> As currently the initializers are reordered to match member order in
> record declaration there is no easy way for an AST consumer to know in
> which order the initializers were written in the source file.

Originally, I had imagined that we would compare based on source locations, and perhaps add an "implicit" bit for implicitly-generated initializers. Does that not work?

> I'd suggest to insert an index field to each CXXBaseOrMemberInitializer
> that is 1 for the first initializer, 2 for the second and so no. The
> index is 0 for the initializers that are not present in source file.
> 
> Can we proceed in this direction?

I would like to avoid adding an index field, if the source locations suffice. 



More information about the cfe-dev mailing list