[cfe-dev] Inherited members/functions in CXXRecordDecl
David Come via cfe-dev
cfe-dev at lists.llvm.org
Wed Nov 16 07:24:22 PST 2016
I'm a a bit puzzled. Because clang has to know about these attributes
later on (for looking up the symbol if used, or when computing the class
size).
it means somewhere it's done, I don't know where =/
Thanks.
David
On 15/11/2016 15:30, David Blaikie wrote:
> I would expect you'd have to look at the base class, yes - the AST is,
> at least somewhat, a syntax tree, representing the code as written.
>
> On Tue, Nov 15, 2016 at 2:41 AM David Come via cfe-dev
> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
> 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
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161116/3707d809/attachment.html>
More information about the cfe-dev
mailing list