<html>
<head></head>
<body>
<p>Thanks a lot, Manuel. It looks great, but unfortunately, I can't test it as my clang version doesn't recognize equalsBoundNode... I have to solve this problem as my system is not able to identify lots of the matchers in the reference...</p>
<p>Regards,</p>
<p>Pedro.</p>
<br/>
<div><em>El día 27 sep 2013 08:33, Manuel Klimek <klimek@google.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>Something like (untested):</div><p>constructExpr(hasDeclaration(methodDecl(ofClass(recordDecl().bind("constructedType")))), hasAncestor(methodDecl(ofClass(recordDecl(isDerivedFrom(equalsBoundNode("constructedType"))))))).bind("constructExpr")</p>
<div>Cheers,</div><div>/Manuel</div></div><div class="gmail_extra"><br /><br /><div class="gmail_quote">On Thu, Sep 26, 2013 at 11:40 AM, Pedro Delgado Perez <span dir="ltr"><<a href="mailto:pedro.delgado@uca.es" target="_blank">pedro.delgado@uca.es</a>></span> wrote:<br /><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div class="HOEnZb"><div class="h5"><div><blockquote style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>I'm not sure what the question is. You do not want definitions of what?</p>
</blockquote><p>What I need is to find every call to a parent class constructor. Regarding the example I put, I want to match the invokation "A()" and I'm pretty lost in this case...</p>
<blockquote style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>Use hasType to match on the type of an expression.</p>
</blockquote><p>Ok, that's good. But, I don't know how could I express that the type is a constructorDecl from a parent class...</p>
<p>Thanks,</p>
<p>Pedro.</p>
<br/>
<div><em>El día 26 sep 2013 11:19, Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>> escribió:</em></div><blockquote style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">On Thu, Sep 26, 2013 at 9:26 AM, Pedro Delgado Perez <span dir="ltr"><<a href="mailto:pedro.delgadoperez@mail.uca.es" target="_blank">pedro.delgadoperez@mail.uca.es</a>></span> wrote:<br /><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><p>Hello,</p>
<p>Sorry to write you directly, but I have been sending this message since two days ago to cfe-dev but my message is not posted and I need help as soon as possible.</p>
<p>This is the message:</p>
<p>"Up to now, I have been using matchers to match declarations, but now, I need to match an expression and I am having some problems.<br /> I am looking for a CXXConstructExpr like the one marked in bold in the next example:<br /> class A{<br />    A() {...}<br />    ...<br /> };<br /> class B: public A{<br />      B () {<strong> A (); </strong>}<br /> }<br />I think the matcher should follow this structure:<br />StatementMatcher CE = constructExpr(...);</p>
<p>Then:<br /><br /> 1. If I put nothing within the parentheses, "A()" in class A, "B()" and "A()" in class B are all retrieved. Therefore, I need to indicate that I do not want the definitions. Thus, I thought about the matcher "isDefinition", but it is only for the type "Decl", how can I solve this problem? <br /> The only thing that I have found is the matcher "hasDeclaration", but I do not know how this matcher could help me in this task. </p>
</div></blockquote><div>I'm not sure what the question is. You do not want definitions of what?</div><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><p>2. I also need to ensure that the constructor invoked belongs to a parent class. In the same way, when matching declarations I can ask if the CXXConstructDecl "B()" is "ofClass(recordDecl(isDerivedFrom(...)))". But, with an expression...</p>
</div></blockquote><div>Use hasType to match on the type of an expression.</div><div>Cheers,</div><div>/Manuel</div></div></div></div></blockquote></div></div></div></blockquote></div><br/>
</div></blockquote>
</body>
</html>