<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>thanks for the answer and for the promised fix. Please also consider renaming recordDecl matcher to cxxRecordDecl to reflect the correct type</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span style="color:rgb(34,34,34)">There is no "return" kind on a matcher because the matcher always returns 'bool'.</span><br></div></blockquote></div></div><span class=""><div> </div></span></div></div></div></blockquote><div><br></div><div>was bit dizzy from the matchers, so maybe did not express myself correctly. Was more using the wording from <a href="http://clang.llvm.org/docs/LibASTMatchersReference.html">http://clang.llvm.org/docs/LibASTMatchersReference.html</a></div><div>Was referring to the "returned" objects by the matchers and not the return type of o matcher method on a node. Now going back to this page, I think there is a mistake in the header of the matchers table. I think the "Parameters" should be swapped with the "Return types". Or I am still confused with the wording. Does "parameter" here mean the ast node argument passed to the matcher method? That is recordDecl is applied aggainst Decl and returns CXXRecord? <br>Also after reading through the table few times I discovered that the matcher names are "clickable" and a little doc expands. Probably not so obvious for most people.<br><br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>It is impossible to know the real type of the node before matching, as it could be a subclass of what you are matching.<br></div></div></div></blockquote></span></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>A DynTypedMatcher has 2 "Kinds": SupportedKind and RestrictKind.</div></div></div></div></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>SupportedKind is the minimum static type that the matcher accepts. This is the argument type used in the static matcher declaration.</div><div>It is used to simulate the compile time errors you would get on the static matchers during parsing of the dynamic matchers.</div><div>For example, recordDecl() has a SupportedKind of Decl because it takes any Decl node to check if it is a CXXRecordDecl, hasName() has a SupportedKind of NamedDecl.</div><div><br></div><div>RestrictKind is the minimum dynamic type that the matcher accepts. This is used to do the type matching.</div><div>For example, recordDecl() has a RestrictKind of CXXRecordDecl because it needs a node that is a CXXRecordDecl, hasName() has a RestrictKind of NamedDecl.</div><div>There are some optimizations on the dynamic matcher creation that propagates and combines the RestrictKind to reject values earlier. RestrictKind has to be the same or a subclass of SupportedKind.</div><div><br></div><div>You should be able to use RestrictKind to determine the API supported by the matched node.</div><span class=""><div></div></span></div></div></div></blockquote><div><br></div><div>Well, was not trying to find out the the "real" type as obviously the real type is hidden in the ast itself and that is not known when the matcher is being constructed. I am interested indeed in the RestrictedType, Will give a try in few days and report.</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_signature">rgrds,<br>mobi phil<br><br>being mobile, but including technology<br><a href="http://mobiphil.com">http://mobiphil.com</a></div>
</div></div>