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