[cfe-dev] libTooling Questions

Philip Craig philipjcraig at gmail.com
Sun Aug 12 18:12:25 PDT 2012


On Mon, Aug 13, 2012 at 6:42 AM, Jens Weller <JensWeller at gmx.de> wrote:
> Referring to the example:
> http://clang.llvm.org/docs/RAVFrontendAction.html
>
> Lets say I add a nother visiting method, for methoddeclaration.
> How to match in the invocation of the methodhandler, which class this one belongs to?
> Do I get a fully qualified name (e.g. myclass::foo) or just foo.

For the following code, only the second declaration of foo will have
the 'A::' NestedNameSpecifier.

class A {
  void foo();
};

void A::foo() {}

But you can still get the class using CXXMethodDecl::getParent().



More information about the cfe-dev mailing list