File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1558,7 +1558,27 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
15581558 out << " Line " << tok->linenr () << std::endl;
15591559 line = tok->linenr ();
15601560 if (!xml) {
1561- out << " " << tok->str () << (tok->mImpl ->mValues ->front ().isKnown () ? " always " : " possible " );
1561+ ValueFlow::Value::ValueKind valueKind = tok->mImpl ->mValues ->front ().valueKind ;
1562+ bool same = true ;
1563+ for (const ValueFlow::Value &value : *tok->mImpl ->mValues ) {
1564+ if (value.valueKind != valueKind) {
1565+ same = false ;
1566+ break ;
1567+ }
1568+ }
1569+ out << " " << tok->str () << " " ;
1570+ if (same) {
1571+ switch (valueKind) {
1572+ case ValueFlow::Value::ValueKind::Impossible:
1573+ case ValueFlow::Value::ValueKind::Known:
1574+ out << " always " ;
1575+ break ;
1576+ case ValueFlow::Value::ValueKind::Inconclusive:
1577+ case ValueFlow::Value::ValueKind::Possible:
1578+ out << " possible " ;
1579+ break ;
1580+ };
1581+ }
15621582 if (tok->mImpl ->mValues ->size () > 1U )
15631583 out << ' {' ;
15641584 }
You can’t perform that action at this time.
0 commit comments