Fixed #506 (###### If you see this, there is a bug ###### Token::Match())
This commit is contained in:
parent
0e61395a63
commit
ea49b433ec
|
@ -1139,6 +1139,9 @@ void CheckOther::postIncrement()
|
||||||
tok2 = tok2->tokAt(-3);
|
tok2 = tok2->tokAt(-3);
|
||||||
if (Token::Match(tok2, "; %var% ++|-- )"))
|
if (Token::Match(tok2, "; %var% ++|-- )"))
|
||||||
{
|
{
|
||||||
|
if (tok2->next()->varId() == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Take a look at the variable declaration
|
// Take a look at the variable declaration
|
||||||
const Token *decltok = Token::findmatch(_tokenizer->tokens(), "%varid%", tok2->tokAt(1)->varId());
|
const Token *decltok = Token::findmatch(_tokenizer->tokens(), "%varid%", tok2->tokAt(1)->varId());
|
||||||
const std::string classDef = std::string("class ") + std::string(decltok->previous()->strAt(0));
|
const std::string classDef = std::string("class ") + std::string(decltok->previous()->strAt(0));
|
||||||
|
|
Loading…
Reference in New Issue