[cfe-dev] forEachDescendant(eachOf(...)) working on clang-query but not on clang
Manuel Klimek via cfe-dev
cfe-dev at lists.llvm.org
Mon Nov 28 23:37:38 PST 2016
On Mon, Nov 28, 2016 at 9:55 PM Farzad Sadeghi via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> so the name pretty much says it all.
> so for example we have this matcher:
> forStmt(forEachDescendant(eachOf(unaryOperator(hasOperatorName("--")),
> binaryOperator(hasOperatorName("=")))))
>
it runs fine on clang-query but when i try to compile it with clang i get
> this:
> mutator-lvl0.cpp:1464:32: error: no matching function for call to
> object of type 'const
> internal::ArgumentAdaptingMatcherFunc<internal::ForEachDescendantMatcher>'
>
> Matcher.addMatcher(forStmt(forEachDescendant(eachOf(unaryOperator(hasOperatorName("--")),
> binaryOperator(hasOperatorName("="))))).bind("mccse136daddy"),
> &HandlerForCSE136);
> ^~~~~~~~~~~~~~~~~
> so was wondering what can i do to fix this, since i need the matcher
> that i just wrote.
>
forEachDescendant(eachOf()) will probably not work - you'll have to say
what node type you expect, like forEachDescendant(stmt(eachOf(...)))
> --
> Farzad Sadeghi
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161129/18b8a1d0/attachment.html>
More information about the cfe-dev
mailing list