[cfe-dev] automatically generated declarations in the AST

Jan Bierbaum s3306700 at inf.tu-dresden.de
Thu Aug 19 03:33:45 PDT 2010


Hi!

Is there any mechanism to identify automatically generated nodes inside
the AST? I found CXXRecordDecl::hasDeclaredDefaultConstructor() etc. but
there are also other auto generated nodes. I tried to use the source
location but this is not consistent, e.g. the auto generated ctors do
have a valid source location despite not having any source code.

Another issue are anonymous namespaces. After the first occurrence,
Clang will insert an using directive. Fine. The problem is, that this
directive does have a valid source location, but the namespace
declarations don't. The beginning of their SourceRanges is invalid, the
end is correct. Is this intended behavior? How can I get the correct
start locations?


Regards, Jan.




More information about the cfe-dev mailing list