From ad17e69923ec39b6439ac0041e69de1f1f5ecec4 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 26 Jul 2022 11:26:52 +0200 Subject: [PATCH] [analyzer] Fix unused variable warning in release builds. NFC. --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 936d4ed..19149d0 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -541,8 +541,6 @@ ExprEngine::addObjectUnderConstruction(ProgramStateRef State, if (const auto *AILE = dyn_cast_or_null(Init)) Init = AILE->getSubExpr(); - const auto *E = dyn_cast_or_null(Init); - // FIXME: Currently the state might already contain the marker due to // incorrect handling of temporaries bound to default parameters. // The state will already contain the marker if we construct elements @@ -552,7 +550,8 @@ ExprEngine::addObjectUnderConstruction(ProgramStateRef State, assert((!State->get(Key) || Key.getItem().getKind() == ConstructionContextItem::TemporaryDestructorKind || - State->contains({E, LC})) && + State->contains( + {dyn_cast_or_null(Init), LC})) && "The object is already marked as `UnderConstruction`, when it's not " "supposed to!"); return State->set(Key, V); -- 2.7.4