[cfe-dev] Getting past error: member access into incomplete type

James Dennett james.dennett at gmail.com
Sat Sep 1 23:04:30 PDT 2012

On Sat, Sep 1, 2012 at 6:14 PM, Eric Schulte <eric.schulte at gmx.com> wrote:
> Hi,
> I'm working on a small AST-manipulation tool built upon clang [1].  I
> had an implementation which worked but didn't deal well with included
> headings.  I've since re-written this using the Tooling interface,
> however using the example code from [2] I run into the following "member
> access into incomplete type" error on an ASTContext [3].
> It looks like I could solve this error by stepping back to previous
> versions of clang and llvm [4], but I'd prefer to fix this so that it
> works with the current code and moving forward.  The broken file is at,
> https://github.com/eschulte/clang-mutate/blob/master/mutate-tool.cpp
> Any suggestions would be greatly appreciated.

If I'm reading this correctly, your code just needs to #include the
definition of the ASTContext class (from
include/clang/AST/ASTContext.h) in order to refer to a member of
ASTContext (e.g., "Context.getTranslationUnitDecl()").

-- James

More information about the cfe-dev mailing list