<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="">
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>
</body>
</html>