diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index b74935714..a28fdcb0e 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -1655,8 +1655,8 @@ void CheckClass::virtualDestructor() if (printInconclusive) { const Function *destructor = scope->getDestructor(); if (destructor) { - if(!((destructor->hasVirtualSpecifier() && destructor->access == AccessControl::Public) || - (destructor->access == AccessControl::Protected))) { + if (!((destructor->hasVirtualSpecifier() && destructor->access == AccessControl::Public) || + (destructor->access == AccessControl::Protected))) { for (const Function &func : scope->functionList) { if (func.hasVirtualSpecifier()) { inconclusiveErrors.push_back(destructor); diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 7ca6897df..5ef296615 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -172,7 +172,7 @@ namespace { const std::vector &callbacks; std::vector constraints; - void contractConstraints(const Function *function, ExprEngine::ValuePtr (*executeExpression)(const Token*, Data&)) { + void contractConstraints(const Function *function, ExprEngine::ValuePtr(*executeExpression)(const Token*, Data&)) { const auto it = settings->functionContracts.find(currentFunction); if (it == settings->functionContracts.end()) return; diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 5f5daa171..1319b420f 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -1044,8 +1044,7 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti temp.functionContracts[function] = expects; } } - } - else if (strcmp(node->Name(), CppcheckXml::IgnoreElementName) == 0) + } else if (strcmp(node->Name(), CppcheckXml::IgnoreElementName) == 0) guiProject.excludedPaths = readXmlStringList(node, "", CppcheckXml::IgnorePathName, CppcheckXml::IgnorePathNameAttrib); else if (strcmp(node->Name(), CppcheckXml::LibrariesElementName) == 0) guiProject.libraries = readXmlStringList(node, "", CppcheckXml::LibraryElementName, nullptr); diff --git a/test/testclass.cpp b/test/testclass.cpp index 75eece4de..b589b43ab 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -2699,7 +2699,7 @@ private: " delete base;\n" "}\n", true); ASSERT_EQUALS("[test.cpp:3]: (error) Class 'Base' which is inherited by class 'Derived' does not have a virtual destructor.\n", errout.str()); - + // class Base destructor is not virtual but protected -> no error checkVirtualDestructor("class Base {\n" "public:\n"