[analyzer] Fix unused variable warning in release builds. NFC.

This commit is contained in:
Benjamin Kramer 2022-07-26 11:26:52 +02:00
parent 48a1a993fb
commit ad17e69923
1 changed files with 2 additions and 3 deletions

View File

@ -541,8 +541,6 @@ ExprEngine::addObjectUnderConstruction(ProgramStateRef State,
if (const auto *AILE = dyn_cast_or_null<ArrayInitLoopExpr>(Init))
Init = AILE->getSubExpr();
const auto *E = dyn_cast_or_null<CXXConstructExpr>(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<ObjectsUnderConstruction>(Key) ||
Key.getItem().getKind() ==
ConstructionContextItem::TemporaryDestructorKind ||
State->contains<IndexOfElementToConstruct>({E, LC})) &&
State->contains<IndexOfElementToConstruct>(
{dyn_cast_or_null<CXXConstructExpr>(Init), LC})) &&
"The object is already marked as `UnderConstruction`, when it's not "
"supposed to!");
return State->set<ObjectsUnderConstruction>(Key, V);