<div dir="ltr">On Thu, Oct 3, 2013 at 12:45 PM, Daniel Quiñones Lopez <span dir="ltr"><<a href="mailto:kaos09@hotmail.com" target="_blank">kaos09@hotmail.com</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><div dir="ltr">Hello,<br>I need to make a matcher that finds an initializing operation inside a constructor. In the following code is the underlined expression:<br><br><blockquote>class X {<br> int a;<br> X(int b) {<u><b>a=b;</b></u>}<br>
};<br><br></blockquote>What I have for now is the following matcher:<br><br><blockquote>DeclarationMatcher CID1_Matcher = constructorDecl(<br> isDefinition(),<br> forEachConstructorInitializer(<br>
</blockquote></div></div></blockquote><div><br></div><div>What you're trying to match is not a constructor initializer. It's an assignment inside the definition of the constructor... </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><blockquote> (isWritten(),<br> withInitializer(<br> compoundStmt(<br> binaryOperator(<br> hasOperatorName("=")<br>
)<br> ).bind("CID1")<br> ))<br> )<br> );<br></blockquote><br>But it doesn't matches anything. What I'm doing wrong?<br>
</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>