Fix the -Wunused-variable warning.
authorHaojian Wu <hokein@google.com>
Wed, 14 Aug 2019 08:20:42 +0000 (08:20 +0000)
committerHaojian Wu <hokein@google.com>
Wed, 14 Aug 2019 08:20:42 +0000 (08:20 +0000)
llvm-svn: 368808

clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

index f2983b7..faf9481 100644 (file)
@@ -2180,7 +2180,7 @@ llvm::iterator_range<BugReport::ranges_iterator> BugReport::getRanges() const {
   // If no custom ranges, add the range of the statement corresponding to
   // the error node.
   if (Ranges.empty()) {
-    if (const auto *E = dyn_cast_or_null<Expr>(getStmt()))
+    if (dyn_cast_or_null<Expr>(getStmt()))
       return llvm::make_range(&ErrorNodeRange, &ErrorNodeRange + 1);
     return llvm::make_range(ranges_iterator(), ranges_iterator());
   }
index 21e488f..f0c8de2 100644 (file)
@@ -1987,7 +1987,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode,
     if (const auto *SR = L->getRegionAs<SymbolicRegion>()) {
       if (SR->getSymbol()->getType()->getPointeeType()->isVoidType())
         CanDereference = false;
-    } else if (const auto *AR = L->getRegionAs<AllocaRegion>())
+    } else if (L->getRegionAs<AllocaRegion>())
       CanDereference = false;
 
     // At this point we are dealing with the region's LValue.