From fb10396cb329305e9d31d1a7aa76b87a3f41b63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 23 Jan 2010 09:38:35 +0100 Subject: [PATCH] only run CheckClass::checkConst if style checking is on --- lib/checkclass.cpp | 3 +++ lib/checkclass.h | 1 + test/testclass.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index e34bff57d..b6dce8e02 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -1401,6 +1401,9 @@ void CheckClass::thisSubtraction() void CheckClass::checkConst() { + if (!_settings->_checkCodingStyle) + return; + for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { if (Token::Match(tok, "class %var% :|{")) diff --git a/lib/checkclass.h b/lib/checkclass.h index 450543050..f507c75c8 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -66,6 +66,7 @@ public: } } checkClass.virtualDestructor(); + checkClass.checkConst(); } diff --git a/test/testclass.cpp b/test/testclass.cpp index 958e2380e..a9b853108 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -1518,6 +1518,7 @@ private: // Check.. Settings settings; + settings._checkCodingStyle = true; CheckClass checkClass(&tokenizer, &settings, this); checkClass.checkConst(); }