<html>
<head></head>
<body>
<p>Thank you very much Gábor,</p>
<p>I'm using clang version 3.3, but indeed the isVirtual and isOverride matchers aren't present in my ASTMatchers.h. If other matchers are missing, I already know where to look for, thanks.</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>Also, instead of isDefaultConstructor(), you could use argumentCountIs(0).</p>
</blockquote><p>What I meant to do is to fetch the node of the default constructor method declaration in order to delete it, not where the calls to that constructor were made, so your suggestion is not what I need. Any other suggestion? I would like to know as well if the default constructor is not empty (i.e., i don't want to fetch a constructor like <em>Foo(){}</em>, but a constructor like <em>Foo(){ a=0;}</em> or <em>Foo():Bar(){}</em>)</p>
<br/>
<p>Thanks,</p>
<p>Pedro.</p>
<div><em>El dia 19 abr 2013 01:58, Gábor Kozár <kozargabor@gmail.com> escribió:</em></div><blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><div><div><div>Hi,<br /><br /></div><p>What version are you using? The matchers isOverride() and isVirtual() I know for certain were not in version 3.2, and can only be found on SVN (in this file: <a href="http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h">http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h</a>).</p>
</div><p>Nonetheless, you can implement them all very easily manually, or just indeed copy their implementation from the link above. Also, instead of isDefaultConstructor(), you could use argumentCountIs(0).</p>
</div><p>Gabor</p>
</div><div class="gmail_extra"><br /><br /><div class="gmail_quote">2013/4/18 Pedro Delgado Perez <span dir="ltr"><<a href="mailto:pedro.delgadoperez@mail.uca.es" target="_blank">pedro.delgadoperez@mail.uca.es</a>></span><br /><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><p>Hi,</p>
<p>I'm newbie using ASTMatchers and I'm trying to learn little by little how to use them.</p>
<p>I was basing on the matcher <span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">recordDecl(hasName("Foo"),</span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify; background-color: #e2e2e2;"> </span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">isDerivedFrom("Bar")) </span>shown in <a href="http://clang.llvm.org/docs/LibASTMatchers.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchers.html</a> trying to include new features. For instance, I tried to look for classes which have at least one virtual method:</p>
<p><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">recordDecl(hasName("Foo"),</span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify; background-color: #e2e2e2;"> </span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">isDerivedFrom("Bar"), hasMethod(isVirtual()))</span></p>
<p>Or I tried to match protected overriden methods:</p>
<p><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">methodDecl(allOf(isProtected(), isOverride()</span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">);</span></p>
<p>But neither of them worked as it couldn't find "isOverride" and "isVirtual" identifiers. I was trying a lot of combinations, but I can't understand this well.</p>
<p>Finally, I tried to look for the the default constructor of a certain class:</p>
<p><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">constructorDecl(hasName("Foo"), isDefaultConstructor())</span></p>
<p>but this is wrong. What I'm doing bad? Please, any information you give me will be fine to me to understand how to use matchers.</p>
<p>Thanks in advance,</p>
<p>Pedro.</p>
<br/>
</div><br/>
<p>_______________________________________________<br/>
cfe-dev mailing list<br/>
cfe-dev@cs.uiuc.edu</p>
</blockquote></div></div><p><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></p>
</blockquote>
</body>
</html>