<div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 15, 2016 at 2:41 AM David Come via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
I'm using clang and libtooling 3.9 to parse some C++ code.<br class="gmail_msg">
<br class="gmail_msg">
With the following snippet :<br class="gmail_msg">
<br class="gmail_msg">
struct A0 {<br class="gmail_msg">
char* p;<br class="gmail_msg">
void Z();<br class="gmail_msg">
};<br class="gmail_msg">
struct A : A0{<br class="gmail_msg">
const int i;<br class="gmail_msg">
volatile double g;<br class="gmail_msg">
protected:<br class="gmail_msg">
void f(){};<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
When iterating over fields and methods on A's CXXRecordDecl in my visitor,<br class="gmail_msg">
<br class="gmail_msg">
I only get fields i and g ; and method f. I completely miss p and Z.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Is this normal ? How can I get them when looking at A's CXXRecordDecl ?<br class="gmail_msg">
Do I have to iterate over A base classes and add A0's public/protected<br class="gmail_msg">
members ?<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Thanks.<br class="gmail_msg">
<br class="gmail_msg">
David Come<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
cfe-dev mailing list<br class="gmail_msg">
<a href="mailto:cfe-dev@lists.llvm.org" class="gmail_msg" target="_blank">cfe-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="gmail_msg">
</blockquote></div>