From 592177200ade0f242ce0f257b1bd183c92600c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Apr 2015 13:34:44 +0200 Subject: [PATCH] don't print warning message if --enable=warning is not given. message was of type: (warning) Call of pure virtual function 'foo' in constructor. --- lib/checkclass.cpp | 2 ++ test/testclass.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index e27c6387b..776f8d319 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -2101,6 +2101,8 @@ void CheckClass::selfInitializationError(const Token* tok, const std::string& va void CheckClass::checkPureVirtualFunctionCall() { + if (! _settings->isEnabled("warning")) + return; const std::size_t functions = symbolDatabase->functionScopes.size(); std::map > callsPureVirtualFunctionMap; for (std::size_t i = 0; i < functions; ++i) { diff --git a/test/testclass.cpp b/test/testclass.cpp index 40d655da9..0f6d7896c 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -6045,7 +6045,7 @@ private: if (s) settings = *s; else - settings.addEnabled("style"); + settings.addEnabled("warning"); settings.inconclusive = inconclusive; // Tokenize..