[cfe-dev] RecursiveASTVisitor: How to traverse all FieldDecl in a CXXRecordDecl?

Marcel Schaible via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 30 08:48:58 PST 2020


Hi,

I have  simple RecursiveASTVisitor, which should handle definition of 
structs and their fields.


How can I traverse over all FieldDecl in a given CXXRecordDecl?

Because of the sequence the AST is traversed, I don't know in a 
VisitFieldDecl approach to which CXXRecordDecl it belongs to.

I hope I have stated my problem understandable..-


Thanks

Marcel


More information about the cfe-dev mailing list