use inline suppressions for varid0 in selfcheck (#3842)
This commit is contained in:
parent
0c1aea87fb
commit
b6876d22e6
|
@ -16,7 +16,6 @@ symbolDatabaseWarning:tools/triage/moc_*.cpp
|
||||||
# debug suppressions
|
# debug suppressions
|
||||||
valueFlowBailout
|
valueFlowBailout
|
||||||
valueFlowBailoutIncompleteVar
|
valueFlowBailoutIncompleteVar
|
||||||
varid0
|
|
||||||
autoNoType
|
autoNoType
|
||||||
bailoutUninitVar
|
bailoutUninitVar
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ bool isZero(T x)
|
||||||
template<class R, class T>
|
template<class R, class T>
|
||||||
R calculate(const std::string& s, const T& x, const T& y, bool* error = nullptr)
|
R calculate(const std::string& s, const T& x, const T& y, bool* error = nullptr)
|
||||||
{
|
{
|
||||||
|
// cppcheck-suppress varid0
|
||||||
auto wrap = [](T z) {
|
auto wrap = [](T z) {
|
||||||
return R{z};
|
return R{z};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1161,6 +1161,7 @@ static int estimateSize(const Type* type, const Settings* settings, const Symbol
|
||||||
|
|
||||||
int cumulatedSize = 0;
|
int cumulatedSize = 0;
|
||||||
const bool isUnion = type->classScope->type == Scope::ScopeType::eUnion;
|
const bool isUnion = type->classScope->type == Scope::ScopeType::eUnion;
|
||||||
|
// cppcheck-suppress varid0
|
||||||
const auto accumulateSize = [](int& cumulatedSize, int size, bool isUnion) -> void {
|
const auto accumulateSize = [](int& cumulatedSize, int size, bool isUnion) -> void {
|
||||||
if (isUnion)
|
if (isUnion)
|
||||||
cumulatedSize = std::max(cumulatedSize, size);
|
cumulatedSize = std::max(cumulatedSize, size);
|
||||||
|
|
|
@ -58,6 +58,7 @@ std::string Summaries::create(const Tokenizer *tokenizer, const std::string &cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write summary for function
|
// Write summary for function
|
||||||
|
// cppcheck-suppress varid0
|
||||||
auto join = [](const std::set<std::string> &data) -> std::string {
|
auto join = [](const std::set<std::string> &data) -> std::string {
|
||||||
std::string ret;
|
std::string ret;
|
||||||
const char *sep = "";
|
const char *sep = "";
|
||||||
|
|
|
@ -3967,6 +3967,7 @@ void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *s
|
||||||
argType = findVariableTypeIncludingUsedNamespaces(symbolDatabase, scope, typeTok);
|
argType = findVariableTypeIncludingUsedNamespaces(symbolDatabase, scope, typeTok);
|
||||||
|
|
||||||
// save type
|
// save type
|
||||||
|
// cppcheck-suppress varid0
|
||||||
const_cast<Token *>(typeTok)->type(argType);
|
const_cast<Token *>(typeTok)->type(argType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4138,6 +4138,7 @@ static void valueFlowLifetime(TokenList *tokenlist, SymbolDatabase*, ErrorLogger
|
||||||
};
|
};
|
||||||
|
|
||||||
bool update = false;
|
bool update = false;
|
||||||
|
// cppcheck-suppress varid0
|
||||||
auto captureVariable = [&](const Token* tok2, Lambda::Capture c, std::function<bool(const Token*)> pred) {
|
auto captureVariable = [&](const Token* tok2, Lambda::Capture c, std::function<bool(const Token*)> pred) {
|
||||||
if (varids.count(tok->varId()) > 0)
|
if (varids.count(tok->varId()) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue