[clang] 0cd4d47 - [clang][StaticAnalyzer] Fix unused variable warning for debug builds

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 04:36:22 PDT 2020


Author: Kadir Cetinkaya
Date: 2020-06-09T13:35:41+02:00
New Revision: 0cd4d47cfef09c9486173af149f171ff3c137367

URL: https://github.com/llvm/llvm-project/commit/0cd4d47cfef09c9486173af149f171ff3c137367
DIFF: https://github.com/llvm/llvm-project/commit/0cd4d47cfef09c9486173af149f171ff3c137367.diff

LOG: [clang][StaticAnalyzer] Fix unused variable warning for debug builds

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Core/CallEvent.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index cb8693f3c34c..b8d8d467341d 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -479,8 +479,7 @@ static void addParameterValuesToBindings(const StackFrameContext *CalleeCtx,
   unsigned Idx = 0;
   ArrayRef<ParmVarDecl*>::iterator I = parameters.begin(), E = parameters.end();
   for (; I != E && Idx < NumArgs; ++I, ++Idx) {
-    const ParmVarDecl *ParamDecl = *I;
-    assert(ParamDecl && "Formal parameter has no decl?");
+    assert(*I && "Formal parameter has no decl?");
 
     // TODO: Support allocator calls.
     if (Call.getKind() != CE_CXXAllocator)


        


More information about the cfe-commits mailing list