]> granicus.if.org Git - clang/commitdiff
Resolve unused variable 'VR' warning in RetainCountChecker.cpp
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Sun, 18 Mar 2018 16:07:20 +0000 (16:07 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Sun, 18 Mar 2018 16:07:20 +0000 (16:07 +0000)
Getting rid of
  error: unused variable 'VR' [-Werror,-Wunused-variable]
warning/error at
  lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:1933

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327802 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp

index a8917979473bb6e9cd1d0dbf93f9f2b826bbdd10..98d5fcfb9c1c87dd233fedba8613288fdf1dde38 100644 (file)
@@ -1931,7 +1931,7 @@ static bool isNumericLiteralExpression(const Expr *E) {
 
 static Optional<std::string> describeRegion(const MemRegion *MR) {
   if (const auto *VR = dyn_cast_or_null<VarRegion>(MR))
-    return std::string(cast<VarRegion>(MR)->getDecl()->getName());
+    return std::string(VR->getDecl()->getName());
   // Once we support more storage locations for bindings,
   // this would need to be improved.
   return None;