<div dir="auto">Hi Aaron,<div dir="auto"><br></div><div dir="auto">Thanks for the answer.</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Shraiysh</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 16, 2019, 7:09 PM Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Dec 16, 2019 at 5:50 AM Shraiysh Vaishay via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I was looking for a matcher all overloaded operators.<br>
><br>
> `cxxMethodDecl(hasOverloadedOperatorName("+"))` matches overloaded "+". How do I modify this to match all operator overloads?<br>
><br>
> Any help would be appreciated.<br>
<br>
We don't currently have a matcher that makes this trivial (I was<br>
thinking cxxMethodDecl(hasOverloadedOperatorName(anything())) might<br>
work, but there's a type mismatch between anything() and a string).<br>
<br>
You could add a matcher for this pretty easily if you are in C++ with:<br>
<br>
AST_MATCHER(CXXMethodDecl, isOverloadedOperator) {<br>
return Node.isOverloadedOperator();<br>
}<br>
<br>
~Aaron<br>
<br>
><br>
> Thanks and regards<br>
> Shraiysh<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>