Open
Description
Thanks to @AaronBallman on IRC for helping me understand the actual problem here.
In some cases when presented with a bogus query, clang-query not only fails to detect it, but it responds with bogus matches.
Simplified test-case:
int testfunc(int)
{
return 0;
}
void caller()
{
using functype = int(*)(int);
functype fpointer = testfunc;
fpointer(1);
return;
}
clang-query> m invocation(functionDecl(returns(asString("void"))))
Match #1:
/home/cory/dev/bitcoin-tidy/build/../example2.cc:10:5: note: "root" binds here
fpointer(1);
^~~~~~~~~~~
1 match.
Rather than complaining about invocation
being incompatible with functionDecl
as it apparently should (thanks @AaronBallman!), a match is returned.