diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp')
| -rw-r--r-- | contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp index e78c130a9c22..c8ddf3b2c14f 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp @@ -309,7 +309,7 @@ MoveChecker::MovedBugVisitor::VisitNode(const ExplodedNode *N,        // If it's not a dereference, we don't care if it was reset to null        // or that it is even a smart pointer. -      LLVM_FALLTHROUGH; +      [[fallthrough]];      case SK_NonStd:      case SK_Safe:        OS << "Object"; @@ -587,7 +587,7 @@ void MoveChecker::explainObject(llvm::raw_ostream &OS, const MemRegion *MR,          break;        // We only care about the type if it's a dereference. -      LLVM_FALLTHROUGH; +      [[fallthrough]];      case SK_Unsafe:        OS << " of type '" << RD->getQualifiedNameAsString() << "'";        break; @@ -618,10 +618,6 @@ void MoveChecker::checkPreCall(const CallEvent &Call, CheckerContext &C) const {    if (!IC)      return; -  // Calling a destructor on a moved object is fine. -  if (isa<CXXDestructorCall>(IC)) -    return; -    const MemRegion *ThisRegion = IC->getCXXThisVal().getAsRegion();    if (!ThisRegion)      return; @@ -631,6 +627,10 @@ void MoveChecker::checkPreCall(const CallEvent &Call, CheckerContext &C) const {    if (!MethodDecl)      return; +  // Calling a destructor on a moved object is fine. +  if (isa<CXXDestructorDecl>(MethodDecl)) +    return; +    // We want to investigate the whole object, not only sub-object of a parent    // class in which the encountered method defined.    ThisRegion = ThisRegion->getMostDerivedObjectRegion();  | 
