Explicit constructors: don't warn for abstract classes unless C++11 is used.

This commit is contained in:
Daniel Marjamäki 2015-11-09 08:36:47 +01:00
parent 64f3007d9e
commit 8317369c91
1 changed files with 5 additions and 0 deletions

View File

@ -241,6 +241,11 @@ void CheckClass::checkExplicitConstructors()
}
}
// Abstract classes can't be instantiated. But if there is "misuse" by derived
// classes then these constructors must be explicit.
if (isAbstractClass && _settings->standards.cpp != Standards::CPP11)
continue;
for (std::list<Function>::const_iterator func = scope->functionList.begin(); func != scope->functionList.end(); ++func) {
// We are looking for constructors, which are meeting following criteria: