[analyzer] Silence GCC warnings about unused variables. NFC.

Use `isa<T>()` instead of `Type *Var = dyn_cast<T>()`
when the result of the cast isn't used.
This commit is contained in:
Martin Storsjö 2022-08-29 12:10:07 +03:00
parent 5f0080fbe8
commit efc76a1ac5

View File

@ -1217,7 +1217,7 @@ void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor Dtor,
}
unsigned Idx = 0;
if (const auto *AT = dyn_cast<ArrayType>(varType)) {
if (isa<ArrayType>(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<ArrayType>(T)) {
if (isa<ArrayType>(T)) {
SVal ElementCount;
std::tie(State, Idx) = prepareStateForArrayDestruction(
State, FieldVal.getAsRegion(), T, LCtx, &ElementCount);