This commit is contained in:
Daniel Marjamäki 2013-08-27 15:46:51 +02:00
parent 4189d7db46
commit 65d99feddf
1 changed files with 5 additions and 2 deletions

View File

@ -976,7 +976,10 @@ void CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(const Scope* const
variables.read(tok->next()->varId(), tok); variables.read(tok->next()->varId(), tok);
} else // addressof } else // addressof
variables.use(tok->next()->varId(), tok); // use = read + write variables.use(tok->next()->varId(), tok); // use = read + write
} else if (Token::Match(tok, ">> %var%")) { } else if (Token::Match(tok, ">>|>>= %var%")) {
if (_tokenizer->isC() || tok->previous()->isStandardType())
variables.read(tok->next()->varId(), tok);
else
variables.use(tok->next()->varId(), tok); // use = read + write variables.use(tok->next()->varId(), tok); // use = read + write
} else if (Token::Match(tok, "%var% >>|&") && Token::Match(tok->previous(), "[{};:]")) { } else if (Token::Match(tok, "%var% >>|&") && Token::Match(tok->previous(), "[{};:]")) {
variables.read(tok->varId(), tok); variables.read(tok->varId(), tok);