src/checkstl.cpp(iterators): some corrections.
Corrections for my changes in12ca70fe5a
and347802f819
commits.
This commit is contained in:
parent
0e2273833e
commit
3158e32b7c
|
@ -64,7 +64,7 @@ void CheckStl::iterators()
|
||||||
if (Token::Match(tok2, "%varid% != %var% . end ( )", iteratorId) && tok2->tokAt(2)->varId() != containerId)
|
if (Token::Match(tok2, "%varid% != %var% . end ( )", iteratorId) && tok2->tokAt(2)->varId() != containerId)
|
||||||
{
|
{
|
||||||
iteratorsError(tok2, tok->strAt(2), tok2->strAt(2));
|
iteratorsError(tok2, tok->strAt(2), tok2->strAt(2));
|
||||||
tok2 = tok2->tokAt(7);
|
tok2 = tok2->tokAt(6);
|
||||||
}
|
}
|
||||||
else if (Token::Match(tok2, "%var% . insert|erase ( %varid%", iteratorId))
|
else if (Token::Match(tok2, "%var% . insert|erase ( %varid%", iteratorId))
|
||||||
{
|
{
|
||||||
|
@ -73,17 +73,17 @@ void CheckStl::iterators()
|
||||||
else if (tok2->strAt(2) == std::string("erase"))
|
else if (tok2->strAt(2) == std::string("erase"))
|
||||||
validIterator = false;
|
validIterator = false;
|
||||||
|
|
||||||
tok2 = tok2->tokAt(5);
|
tok2 = tok2->tokAt(4);
|
||||||
}
|
}
|
||||||
else if (!validIterator && Token::Match(tok2, "* %varid%", iteratorId))
|
else if (!validIterator && Token::Match(tok2, "* %varid%", iteratorId))
|
||||||
{
|
{
|
||||||
dereferenceErasedError(tok2, tok2->strAt(1));
|
dereferenceErasedError(tok2, tok2->strAt(1));
|
||||||
tok2 = tok2->tokAt(2);
|
tok2 = tok2->next();
|
||||||
}
|
}
|
||||||
else if (!validIterator && Token::Match(tok2, "%varid% . %var%", iteratorId))
|
else if (!validIterator && Token::Match(tok2, "%varid% . %var%", iteratorId))
|
||||||
{
|
{
|
||||||
dereferenceErasedError(tok2, tok2->strAt(0));
|
dereferenceErasedError(tok2, tok2->strAt(0));
|
||||||
tok2 = tok2->tokAt(3);
|
tok2 = tok2->tokAt(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue