Hi all!
I'm using RecursiveASTVisitor VisitRecordDecl() method to get all struct
name (include typedef name).
e.g.
typedef struct XXX
{
...
}ZZZ;
I want get struct name XXX and ZZZ. I just can get name XXX.
RecordDecl::getTypedefNameForAnonDecl() get a empty point.
So how to get the typedef name?
Thanks all!
In the AST, structs and classes are represented by CXXRecordDecl, while typedefs by TypedefDecl (http://clang.llvm.org/doxygen/classclang_1_1TypedefNameDecl.html). The latter should give you all the information you need.