[cfe-dev] Inherited members/functions in CXXRecordDecl

David Come via cfe-dev cfe-dev at lists.llvm.org
Tue Nov 15 03:41:49 PST 2016


Hello,


I'm using clang and libtooling 3.9 to parse some C++ code.

With the following snippet :

struct A0  {
   char* p;
   void Z();
};
struct A : A0{
   const int i;
   volatile double g;
protected:
   void f(){};
};

When iterating over fields and methods on A's CXXRecordDecl in my visitor,

I only get fields i and g ; and method f. I completely miss p and Z.


Is this normal ? How can I get them when looking at A's CXXRecordDecl ? 
Do I have to iterate over A base classes and add A0's public/protected 
members ?


Thanks.

David Come




More information about the cfe-dev mailing list