diff --git a/lib/token.cpp b/lib/token.cpp index be6d7730e971..711f64a00e39 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -1997,8 +1997,8 @@ static bool removeContradiction(std::list& values) auto compare = [](const ValueFlow::Value& x, const ValueFlow::Value& y) { return x.compareValue(y, less{}); }; - const ValueFlow::Value& maxValue = std::max(x, y, compare); - const ValueFlow::Value& minValue = std::min(x, y, compare); + ValueFlow::Value maxValue = std::max(x, y, compare); + ValueFlow::Value minValue = std::min(x, y, compare); // TODO: Adjust non-points instead of removing them if (maxValue.isImpossible() && maxValue.bound == ValueFlow::Value::Bound::Upper) { values.remove(minValue);