Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Fix inequivalence of operators #531

Closed martong closed 5 years ago

balazske commented 5 years ago

Was this really not checked before?

balazske commented 5 years ago

IsStructurallyEquivalentwith CXXMethodDecl has a check for getOverloadedOperator() that can be removedif the new code is used.

martong commented 5 years ago

IsStructurallyEquivalentwith CXXMethodDecl has a check for getOverloadedOperator() that can be removedif the new code is used.

I don't think so, because when we have a CXXMethodDecl then we do not check the FunctionDecl related things:

  // ...
  } else if (auto *MD1 = dyn_cast<CXXMethodDecl>(D1)) {
    // ...
  } else if (FunctionDecl *FD1 = dyn_cast<FunctionDecl>(D1)) {
    // ...
  } else if (FriendDecl *FrD1 = dyn_cast<FriendDecl>(D1)) {
    // ...
  } // ...
martong commented 5 years ago

Update: Removed getOperatorSpelling.

martong commented 5 years ago

https://reviews.llvm.org/D57902