astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2020-04-27 17:35:52 +02:00
parent 19295d7933
commit 2e369cc842
4 changed files with 5 additions and 6 deletions

View File

@ -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);

View File

@ -172,7 +172,7 @@ namespace {
const std::vector<ExprEngine::Callback> &callbacks;
std::vector<ExprEngine::ValuePtr> 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;

View File

@ -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);

View File

@ -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"