r368808 - Fix the -Wunused-variable warning.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 01:20:42 PDT 2019


Author: hokein
Date: Wed Aug 14 01:20:42 2019
New Revision: 368808

URL: http://llvm.org/viewvc/llvm-project?rev=368808&view=rev
Log:
Fix the -Wunused-variable warning.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=368808&r1=368807&r2=368808&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Wed Aug 14 01:20:42 2019
@@ -2180,7 +2180,7 @@ llvm::iterator_range<BugReport::ranges_i
   // 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());
   }

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=368808&r1=368807&r2=368808&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Wed Aug 14 01:20:42 2019
@@ -1987,7 +1987,7 @@ bool bugreporter::trackExpressionValue(c
     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.




More information about the cfe-commits mailing list