<br><br><div class="gmail_quote">On Sun, Sep 2, 2012 at 8:04 AM, James Dennett <span dir="ltr"><<a href="mailto:james.dennett@gmail.com" target="_blank">james.dennett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sat, Sep 1, 2012 at 6:14 PM, Eric Schulte <<a href="mailto:eric.schulte@gmx.com">eric.schulte@gmx.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm working on a small AST-manipulation tool built upon clang [1].  I<br>
> had an implementation which worked but didn't deal well with included<br>
> headings.  I've since re-written this using the Tooling interface,<br>
> however using the example code from [2] I run into the following "member<br>
> access into incomplete type" error on an ASTContext [3].<br>
><br>
> It looks like I could solve this error by stepping back to previous<br>
> versions of clang and llvm [4], but I'd prefer to fix this so that it<br>
> works with the current code and moving forward.  The broken file is at,<br>
> <a href="https://github.com/eschulte/clang-mutate/blob/master/mutate-tool.cpp" target="_blank">https://github.com/eschulte/clang-mutate/blob/master/mutate-tool.cpp</a><br>
><br>
> Any suggestions would be greatly appreciated.<br>
<br>
</div>If I'm reading this correctly, your code just needs to #include the<br>
definition of the ASTContext class (from<br>
include/clang/AST/ASTContext.h) in order to refer to a member of<br>
ASTContext (e.g., "Context.getTranslationUnitDecl()").<br>
<span class="HOEnZb"><font color="#888888"><br>
-- James<br>
</font></span><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br>I agree with James.<br><br>There has been refactoring on the headers in the AST and Sema (I think) to move from direct inclusion to forward declaration which probably broke a few clients that relied on the inclusions being done for them. Normally if you would just make the inclusion yourself now, it should work as before.<br>
<br>-- Matthieu <br></div></div><br>