Running astyle [ci skip].

This commit is contained in:
orbitcowboy 2020-01-04 00:06:27 +01:00
parent dd05839a7e
commit 1e0f8ae9b4
3 changed files with 11 additions and 8 deletions

View File

@ -1423,7 +1423,9 @@ bool isConstVarExpression(const Token *tok, const char* skipMatch)
if (Token::simpleMatch(tok->astOperand1(), ".") && !isConstVarExpression(tok->astOperand1(), skipMatch))
return false;
std::vector<const Token *> args = getArguments(tok);
return std::all_of(args.begin(), args.end(), [&](const Token* t) { return isConstVarExpression(t, skipMatch); });
return std::all_of(args.begin(), args.end(), [&](const Token* t) {
return isConstVarExpression(t, skipMatch);
});
}
if (isCPPCast(tok)) {
return isConstVarExpression(tok->astOperand2(), skipMatch);

View File

@ -2637,8 +2637,8 @@ void CheckClass::checkAccessModifierVirtualFunctions()
continue;
for (const Function &func : classScope->functionList) {
const Function *baseFunc = func.getOverriddenFunction();
if(baseFunc) {
if(AccessControl::Public == baseFunc->access && AccessControl::Public != func.access) {
if (baseFunc) {
if (AccessControl::Public == baseFunc->access && AccessControl::Public != func.access) {
checkAccessModifierVirtualFunctionsError(func.tokenDef, func.name());
}
}
@ -2649,10 +2649,10 @@ void CheckClass::checkAccessModifierVirtualFunctions()
void CheckClass::checkAccessModifierVirtualFunctionsError(const Token *tok, const std::string& func)
{
reportError(tok, Severity::style, "hidingInheritedPublic",
"$symbol:" + func + "\n"
"The function '$symbol' has more narrow access modifier in a derived class. It could violate a LSP principle.",
CWE(0U) /* Unknown CWE! */,
false);
"$symbol:" + func + "\n"
"The function '$symbol' has more narrow access modifier in a derived class. It could violate a LSP principle.",
CWE(0U) /* Unknown CWE! */,
false);
}
void CheckClass::checkUnsafeClassRefMember()

View File

@ -1074,7 +1074,8 @@ private:
}
void iterator24()
{ // #9556
{
// #9556
check("void f(int a, int b) {\n"
" if (&a == &b) {}\n"
"}\n");