Enable useStlAlgorithm in selfcheck (#4725)
This commit is contained in:
parent
f8f66aeea9
commit
50d297b309
|
@ -2,7 +2,6 @@ shadowFunction
|
|||
bitwiseOnBoolean
|
||||
|
||||
# temporary suppressions - fix the warnings!
|
||||
useStlAlgorithm
|
||||
simplifyUsing:lib/valueptr.h
|
||||
varid0:gui/projectfile.cpp
|
||||
|
||||
|
|
|
@ -243,10 +243,11 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck)
|
|||
}
|
||||
|
||||
bool CppCheckExecutor::reportSuppressions(const Settings &settings, bool unusedFunctionCheckEnabled, const std::map<std::string, std::size_t> &files, ErrorLogger& errorLogger) {
|
||||
for (const Suppressions::Suppression& suppression: settings.nomsg.getSuppressions()) {
|
||||
if (suppression.errorId == "unmatchedSuppression" && suppression.fileName.empty() && suppression.lineNumber == Suppressions::Suppression::NO_LINE)
|
||||
const auto& suppressions = settings.nomsg.getSuppressions();
|
||||
if (std::any_of(suppressions.begin(), suppressions.end(), [](const Suppressions::Suppression& s) {
|
||||
return s.errorId == "unmatchedSuppression" && s.fileName.empty() && s.lineNumber == Suppressions::Suppression::NO_LINE;
|
||||
}))
|
||||
return false;
|
||||
}
|
||||
|
||||
bool err = false;
|
||||
if (settings.jointSuppressionReport) {
|
||||
|
|
|
@ -4633,10 +4633,12 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
|
|||
|
||||
const Variable *Scope::getVariable(const std::string &varname) const
|
||||
{
|
||||
for (const Variable& var: varlist) {
|
||||
if (var.name() == varname)
|
||||
return &var;
|
||||
}
|
||||
auto it = std::find_if(varlist.begin(), varlist.end(), [&varname](const Variable& var) {
|
||||
return var.name() == varname;
|
||||
});
|
||||
if (it != varlist.end())
|
||||
return &*it;
|
||||
|
||||
if (definedType) {
|
||||
for (const Type::BaseInfo& baseInfo: definedType->derivedFrom) {
|
||||
if (baseInfo.type && baseInfo.type->classScope) {
|
||||
|
|
Loading…
Reference in New Issue