clang 3.8, libtooling cannot visit some BinaryOperator

I added code just at the beginning of VisitBinaryOperator like:

bool VisitBinaryOperator(BinaryOperator *b){
    PrintingPolicy policy = PrintingPolicy(this->TheRewriter.getLangOpts());
    b->printPretty(llvm::errs(), NULL, policy);
    llvm::errs()<<'\n';
    if(b->isAssignmentOp()){
        handler.HandleBinaryOperator(b);
    }
    return true;
}
The test code includes these lines:
void setForceMethod(NbodyModel *theModel,int force_method) {
    theModel->force_method=force_method;
}
void setTreeRangeCoefficient(NbodyModel *theModel,double coefficient) {
    theModel->treeRangeCoefficient=coefficient;
}
void setIntMethod(NbodyModel *theModel,int int_method) {
    theModel->int_method=int_method;
}
expected output should include these assignments but I didn't find them in terminal.

Then I’m afraid I’m not sure. Maybe the assignments aren’t classed as a binary operator any longer?

It would be great if you can produce a COMPLETE (but minimal to show the problem) example of both the code you are working on, and the input that you are giving it, for debugging.

It definitely should match:
$ cat /tmp/t.cc
void f() {
int i;
i = 2;
}

$ clang-query /tmp/t.cc –
Parsing /tmp/t.cc: 0.0015 (100.0%) 0.0015 (100.0%) 0.0018 (100.0%)
clang-query> m binaryOperator()
Match #1:
/tmp/t.cc:3:3: note: “root” binds here
i = 2;

If your code doesn’t parse correctly, or doesn’t find some headers, all bets are off, so as the post above said, more context needed.