only run CheckClass::checkConst if style checking is on

This commit is contained in:
Daniel Marjamäki 2010-01-23 09:38:35 +01:00
parent 35c303943f
commit fb10396cb3
3 changed files with 5 additions and 0 deletions

View File

@ -1401,6 +1401,9 @@ void CheckClass::thisSubtraction()
void CheckClass::checkConst() void CheckClass::checkConst()
{ {
if (!_settings->_checkCodingStyle)
return;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{ {
if (Token::Match(tok, "class %var% :|{")) if (Token::Match(tok, "class %var% :|{"))

View File

@ -66,6 +66,7 @@ public:
} }
} }
checkClass.virtualDestructor(); checkClass.virtualDestructor();
checkClass.checkConst();
} }

View File

@ -1518,6 +1518,7 @@ private:
// Check.. // Check..
Settings settings; Settings settings;
settings._checkCodingStyle = true;
CheckClass checkClass(&tokenizer, &settings, this); CheckClass checkClass(&tokenizer, &settings, this);
checkClass.checkConst(); checkClass.checkConst();
} }