[cfe-dev] Matching initializing operations inside a constructor

Daniel QuiƱones Lopez kaos09 at hotmail.com
Thu Oct 3 03:45:21 PDT 2013


Hello,
I need to make a matcher that finds an initializing operation inside a constructor. In the following code is the underlined expression:

class X {
   int a;
   X(int b) {a=b;}
};

What I have for now is the following matcher:

DeclarationMatcher CID1_Matcher = constructorDecl(
                  isDefinition(),
                  forEachConstructorInitializer(
                    (isWritten(),
                    withInitializer(
                      compoundStmt(
                         binaryOperator(
                            hasOperatorName("=")
                         )
                      ).bind("CID1")
                    ))
                  )
                );

But it doesn't matches anything. What I'm doing wrong?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131003/0eea14f4/attachment.html>


More information about the cfe-dev mailing list