From 980a8109951ffe2e1477b1d78cc68fdd07ca9878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 28 Feb 2010 06:56:47 +0100 Subject: [PATCH] STL if find: check given severity --- lib/checkstl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 61f389ef7..77c0e7e06 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -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% ) )")) @@ -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);