From: Haojian Wu Date: Wed, 14 Aug 2019 08:20:42 +0000 (+0000) Subject: Fix the -Wunused-variable warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9958a1776c35f3316f01fddd474e664add499c64;p=clang Fix the -Wunused-variable warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368808 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index f2983b7f4b..faf9481da3 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -2180,7 +2180,7 @@ llvm::iterator_range 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(getStmt())) + if (dyn_cast_or_null(getStmt())) return llvm::make_range(&ErrorNodeRange, &ErrorNodeRange + 1); return llvm::make_range(ranges_iterator(), ranges_iterator()); } diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 21e488ff85..f0c8de26bc 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1987,7 +1987,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, if (const auto *SR = L->getRegionAs()) { if (SR->getSymbol()->getType()->getPointeeType()->isVoidType()) CanDereference = false; - } else if (const auto *AR = L->getRegionAs()) + } else if (L->getRegionAs()) CanDereference = false; // At this point we are dealing with the region's LValue.