static check, VisitBinaryOperator() function's problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

static check, VisitBinaryOperator() function's problem

huc1985
This post was updated on .
Hi, All!

I'm using a RecursiveASTVisitor and implementing its VisitBinaryOperator() method to check the assign operation using "sizeof()".
    My test code like this, it's C code:
    void main()
    {
        int size = sizeof(MSG); //init
        size = sizeof(MSG);     //assign
    }

MSG is a struct; But i find that clang can't access VisitBinaryOperator(). And variable size does't have Init Expr in VisitVarDecl(). I have checked AST,there is no BinaryOperator or other operation. I dont know why.