Skip to content

Commit

Permalink
STL if find: check given severity
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Marjamäki committed Feb 28, 2010
1 parent 88840e6 commit 980a810
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/checkstl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ void CheckStl::findError(const Token *tok)

void CheckStl::if_find()
{
if (!_settings->_checkCodingStyle)
return;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{
if (Token::Match(tok, "if ( !| %var% . find ( %any% ) )"))
Expand All @@ -549,7 +551,7 @@ void CheckStl::if_find()
{
// Locate variable declaration..
const Token * const decl = Token::findmatch(_tokenizer->tokens(), "%varid%", varid);
if (Token::Match(decl->tokAt(-4), ",|;|( std :: string"))
if (_settings->_showAll && Token::Match(decl->tokAt(-4), ",|;|( std :: string"))
if_findError(tok, true);
else if (Token::Match(decl->tokAt(-7), ",|;|( std :: %type% < %type% >"))
if_findError(tok, false);
Expand Down

0 comments on commit 980a810

Please sign in to comment.