This is necessary so that when we wish to print the matchers for a
binding of type CXXMeethodDecl, but which was matched with a base
matcher such as functionDecl() we can inform the user that they can
write functionDecl(cxxMethodDecl(isOverride())) etc.
Adding @sbenza in case he has opinions on this approach. I think it's reasonable, but I also know that changes to the the AST matcher internals sometimes have unintended side effects with the various instantiations.
Use of a std::pair here is unfortunate because it's really hard to keep track of what first and second actually mean. A tiny aggregate with two named members would help.
The problem used to come with the number of template instantiations, but afaik this was with an MSVC configuration that is no longer supported.
In any case, I don't see this change making new template instantiations.
I also don't see any actual use of this newly stored data so I don't see the goal. Is this for diagnostics on failures or something like that?
Ah, I think I was remembering the issues from binary sizes due to template instantiations. I didn't think this would introduce new instantiations, but I thought it might make them all larger in a harmful way. I don't think that's a concern here, but your second set of eyes doesn't hurt.
other -> Other
This doesn't provide the right ordering guarantees. Use std::tie() instead: return std::tie(DynNode, NodeKind) < std::tie(Other.DynNode, Other.NodeKind);