cmake: Fix uninitialized member in HandleDeleteCacheVariables

If there is no existing value, mark the saved entry as UNINITIALIZED
(avoids compiler warning about uninitialized type).

Issue: #21166
This commit is contained in:
Adriaan de Groot
2020-10-05 14:39:37 +02:00
committed by Brad King
parent b1898bf975
commit e4e85c5b2d

View File

@@ -1409,6 +1409,8 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
this->State->GetCacheEntryProperty(save.key, "HELPSTRING")) {
save.help = *help;
}
} else {
save.type = cmStateEnums::CacheEntryType::UNINITIALIZED;
}
saved.push_back(std::move(save));
}