<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
A minimal code sample to trigger the error:<br class="">
<div class=""><br class="">
<div class="">
<div class="">#include "clang/ASTMatchers/ASTMatchers.h"</div>
<div class=""><br class="">
</div>
<div class="">using namespace clang::ast_matchers;</div>
<div class=""><br class="">
</div>
<div class="">int main(int argc, char** argv){</div>
<div class="">    auto m = cxxRecordDecl(has(unless(cxxRecordDecl())));</div>
<div class="">    return 0;</div>
<div class=""><br class="">
</div>
<div class="">}</div>
<div class=""><br class="">
</div>
<div class="">Best, Siegfried</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 16Nov, 2020, at 16:57, Hartogs Siegfried <<a href="mailto:hartogss@student.ethz.ch" class="">hartogss@student.ethz.ch</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hello everyone,
<div class=""><br class="">
</div>
<div class="">Why is it that the following matcher </div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Ubuntu Mono" class="">cxxRecordDecl(has(unless(cxxRecordDecl())))</font></div>
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Ubuntu Mono" class=""><br class="">
</font></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">works in clang-query, but when copied to to a .cpp file, it won't compile the matcher:</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><br class="">
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">../lib/UsingAnalysis.cpp:46:29:
</span><span style="font-variant-ligatures: no-common-ligatures;" class="">error:
</span><span style="font-variant-ligatures: no-common-ligatures;" class="">no matching function for call to object of type 'const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher>'</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    auto m = cxxRecordDecl(has(unless(cxxRecordDecl())));</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">                           ^~~</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">/usr/local/include/clang/ASTMatchers/ASTMatchersInternal.h:1183:3:
</span><span style="font-variant-ligatures: no-common-ligatures;" class="">note: </span>
<span style="font-variant-ligatures: no-common-ligatures" class="">candidate template ignored: could not match 'Matcher' against 'VariadicOperatorMatcher'</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">  operator()(const Matcher<T> &InnerMatcher) const {</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Ubuntu Mono";" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""><br class="">
</span></div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">Tried on macOS 10.13 & Ubuntu 20.04 with LLVM 11.0.0.</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><br class="">
</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">Best,</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">Siegfried</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>