diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp index 903d9ec300e2f6..214e0c061ed7bc 100644 --- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp @@ -686,9 +686,11 @@ void Environment::setValueStrict(const Expr &E, Value &Val) { assert(E.isPRValue()); if (auto *StructVal = dyn_cast(&Val)) { - if (auto *ExistingVal = cast_or_null(getValue(E))) + if ([[maybe_unused]] auto *ExistingVal = + cast_or_null(getValue(E))) assert(&ExistingVal->getAggregateLoc() == &StructVal->getAggregateLoc()); - if (StorageLocation *ExistingLoc = getStorageLocation(E, SkipPast::None)) + if ([[maybe_unused]] StorageLocation *ExistingLoc = + getStorageLocation(E, SkipPast::None)) assert(ExistingLoc == &StructVal->getAggregateLoc()); else setStorageLocation(E, StructVal->getAggregateLoc());