[cfe-dev] ASTMatchers: isVirtual and isOverride
kozargabor at gmail.com
Thu Apr 18 16:58:37 PDT 2013
What version are you using? The matchers isOverride() and isVirtual() I
know for certain were not in version 3.2, and can only be found on SVN (in
Nonetheless, you can implement them all very easily manually, or just
indeed copy their implementation from the link above. Also, instead of
isDefaultConstructor(), you could use argumentCountIs(0).
2013/4/18 Pedro Delgado Perez <pedro.delgadoperez at mail.uca.es>
> I'm newbie using ASTMatchers and I'm trying to learn little by little how
> to use them.
> I was basing on the matcher recordDecl(hasName("Foo"), isDerivedFrom("Bar"))
> shown in http://clang.llvm.org/docs/LibASTMatchers.html trying to include
> new features. For instance, I tried to look for classes which have at least
> one virtual method:
> recordDecl(hasName("Foo"), isDerivedFrom("Bar"), hasMethod(isVirtual()))
> Or I tried to match protected overriden methods:
> methodDecl(allOf(isProtected(), isOverride());
> But neither of them worked as it couldn't find "isOverride" and
> "isVirtual" identifiers. I was trying a lot of combinations, but I can't
> understand this well.
> Finally, I tried to look for the the default constructor of a certain
> constructorDecl(hasName("Foo"), isDefaultConstructor())
> but this is wrong. What I'm doing bad? Please, any information you give me
> will be fine to me to understand how to use matchers.
> Thanks in advance,
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev