<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello, i'm trying to match assigment operations on a class attribute inside a class constructor. I'm doing the following:<br><br><blockquote>DeclarationMatcher CID_Matcher = constructorDecl(<br> isDefinition(),<br> has(<br> compoundStmt(<br> forEach(<br> stmt(<br> binaryOperator(<br> isAssignmentOp(),<br> hasLHS(<br> declRefExpr(to(fieldDecl()))<br> )<br> )<br> ).bind("CID1")<br> )<br> )<br> )<br> );<br><br></blockquote>Being the left operand of the assignment a class attribute and isAssigmentOp() defined as follows:<br><br><blockquote>AST_MATCHER(clang::BinaryOperator, isAssignmentOp) {<br> return Node.isAssignmentOp();<br> }<br></blockquote><br>The problem is that it doesn't match anything this way, but if i left "declRefExpr()" without nothing within it, it only matches variables which were declared inside the constructor, instead of the attributes. So my question is about how is supposed to work "declRefExpr()", beacuse in the AST_MATCHER reference it doesn't give much information, or if it is another way to do this. <br>Thank you.<br> </div></body>
</html>