diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 5c69361ad..8732c6908 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -3019,7 +3019,7 @@ struct LifetimeStore { ValueFlow::Value value; value.valueType = ValueFlow::Value::LIFETIME; - value.lifetimeScope = ValueFlow::Value::Local; + value.lifetimeScope = ValueFlow::Value::LifetimeScope::Local; value.tokvalue = lifeTok; value.errorPath = er; value.lifetimeKind = type; @@ -3045,7 +3045,7 @@ struct LifetimeStore { if (var && var->isArgument()) { ValueFlow::Value value; value.valueType = ValueFlow::Value::LIFETIME; - value.lifetimeScope = ValueFlow::Value::Argument; + value.lifetimeScope = ValueFlow::Value::LifetimeScope::Argument; value.tokvalue = var->nameToken(); value.errorPath = er; value.lifetimeKind = type; @@ -3328,8 +3328,8 @@ static void valueFlowLifetime(TokenList *tokenlist, SymbolDatabase*, ErrorLogger errorPath.emplace_back(tok, "Address of variable taken here."); ValueFlow::Value value; - value.valueType = ValueFlow::Value::LIFETIME; - value.lifetimeScope = ValueFlow::Value::Local; + value.valueType = ValueFlow::Value::ValueType::LIFETIME; + value.lifetimeScope = ValueFlow::Value::LifetimeScope::Local; value.tokvalue = lifeTok; value.errorPath = errorPath; if (astIsPointer(lifeTok) || !Token::Match(lifeTok->astParent(), ".|[")) @@ -3354,8 +3354,8 @@ static void valueFlowLifetime(TokenList *tokenlist, SymbolDatabase*, ErrorLogger errorPath.emplace_back(tok, "Pointer to container is created here."); ValueFlow::Value value; - value.valueType = ValueFlow::Value::LIFETIME; - value.lifetimeScope = ValueFlow::Value::Local; + value.valueType = ValueFlow::Value::ValueType::LIFETIME; + value.lifetimeScope = ValueFlow::Value::LifetimeScope::Local; value.tokvalue = tok; value.errorPath = errorPath; value.lifetimeKind = isIterator ? ValueFlow::Value::LifetimeKind::Iterator : ValueFlow::Value::LifetimeKind::Object; @@ -3384,8 +3384,8 @@ static void valueFlowLifetime(TokenList *tokenlist, SymbolDatabase*, ErrorLogger errorPath.emplace_back(tok, "Array decayed to pointer here."); ValueFlow::Value value; - value.valueType = ValueFlow::Value::LIFETIME; - value.lifetimeScope = ValueFlow::Value::Local; + value.valueType = ValueFlow::Value::ValueType::LIFETIME; + value.lifetimeScope = ValueFlow::Value::LifetimeScope::Local; value.tokvalue = var->nameToken(); value.errorPath = errorPath; setTokenValue(tok, value, tokenlist->getSettings()); @@ -5502,7 +5502,7 @@ ValueFlow::Value::Value(const Token *c, long long val) conditional(false), defaultArg(false), lifetimeKind(LifetimeKind::Object), - lifetimeScope(Local), + lifetimeScope(LifetimeScope::Local), valueKind(ValueKind::Possible) { errorPath.emplace_back(c, "Assuming that condition '" + c->expressionString() + "' is not redundant"); diff --git a/lib/valueflow.h b/lib/valueflow.h index a640fbf6b..3fc77585f 100644 --- a/lib/valueflow.h +++ b/lib/valueflow.h @@ -53,7 +53,7 @@ namespace ValueFlow { conditional(false), defaultArg(false), lifetimeKind(LifetimeKind::Object), - lifetimeScope(Local), + lifetimeScope(LifetimeScope::Local), valueKind(ValueKind::Possible) {} Value(const Token *c, long long val); @@ -131,11 +131,11 @@ namespace ValueFlow { } bool isLocalLifetimeValue() const { - return valueType == ValueType::LIFETIME && lifetimeScope == Local; + return valueType == ValueType::LIFETIME && lifetimeScope == LifetimeScope::Local; } bool isArgumentLifetimeValue() const { - return valueType == ValueType::LIFETIME && lifetimeScope == Argument; + return valueType == ValueType::LIFETIME && lifetimeScope == LifetimeScope::Argument; } /** int value */ @@ -169,7 +169,7 @@ namespace ValueFlow { enum class LifetimeKind {Object, Lambda, Iterator, Address} lifetimeKind; - enum LifetimeScope { Local, Argument } lifetimeScope; + enum class LifetimeScope { Local, Argument } lifetimeScope; static const char * toString(MoveKind moveKind) { switch (moveKind) {