From efc76a1ac5f910776091a48947ca1e90e9068845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 29 Aug 2022 12:10:07 +0300 Subject: [PATCH] [analyzer] Silence GCC warnings about unused variables. NFC. Use `isa()` instead of `Type *Var = dyn_cast()` when the result of the cast isn't used. --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 586e89ef2a17..656a7c1fe590 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1217,7 +1217,7 @@ void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor Dtor, } unsigned Idx = 0; - if (const auto *AT = dyn_cast(varType)) { + if (isa(varType)) { SVal ElementCount; std::tie(state, Idx) = prepareStateForArrayDestruction( state, Region, varType, LCtx, &ElementCount); @@ -1368,7 +1368,7 @@ void ExprEngine::ProcessMemberDtor(const CFGMemberDtor D, SVal FieldVal = State->getLValue(Member, ThisLoc); unsigned Idx = 0; - if (const auto *AT = dyn_cast(T)) { + if (isa(T)) { SVal ElementCount; std::tie(State, Idx) = prepareStateForArrayDestruction( State, FieldVal.getAsRegion(), T, LCtx, &ElementCount);