[cfe-dev] AST matcher "refersToType"

Brian Schiller via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 18 12:56:30 PDT 2019


I believe I've found a mistake in the documentation for the `refersToType`
AST matcher:
https://clang.llvm.org/docs/LibASTMatchersReference.html#refersToType0

The example code makes use of a matcher called `class`, but I am unable to
find such a matcher in the docs, and when I try to use it in clang-query I
get a "matcher not found" error.

I'd be happy to make a patch to the docs, but am actually having trouble
using the `refersToType` matcher at the moment. I'm trying to match calls
to `std::make_unique` specialized with a particular class. That is, I want
`std::make_unique<Demo::Widget>`, but not
`std::make_unique<Something::Else>`. I'd also be happy with a way to filter
for the correct matches in the MatchCallback.

There's a stackoverflow post with a complete code example and a couple
things I've tried available at https://stackoverflow.com/q/58443058/1586229

Thanks,
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191018/455ea316/attachment.html>


More information about the cfe-dev mailing list