Skip to content

Commit 5921772

Browse files
committed
don't print warning message if --enable=warning is not given.
message was of type: (warning) Call of pure virtual function 'foo' in constructor.
1 parent 6ff9a52 commit 5921772

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/checkclass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,8 @@ void CheckClass::selfInitializationError(const Token* tok, const std::string& va
21012101

21022102
void CheckClass::checkPureVirtualFunctionCall()
21032103
{
2104+
if (! _settings->isEnabled("warning"))
2105+
return;
21042106
const std::size_t functions = symbolDatabase->functionScopes.size();
21052107
std::map<const Function *, std::list<const Token *> > callsPureVirtualFunctionMap;
21062108
for (std::size_t i = 0; i < functions; ++i) {

test/testclass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6045,7 +6045,7 @@ class TestClass : public TestFixture {
60456045
if (s)
60466046
settings = *s;
60476047
else
6048-
settings.addEnabled("style");
6048+
settings.addEnabled("warning");
60496049
settings.inconclusive = inconclusive;
60506050

60516051
// Tokenize..

0 commit comments

Comments
 (0)