Fix #10946 Debug warning: autoNoType with lambda (#4824)

This commit is contained in:
chrchr-github 2023-03-12 15:48:20 +01:00 committed by GitHub
parent 980c92d19d
commit e2b2fc2684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -7204,8 +7204,13 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
if (reportDebugWarnings && mSettings.debugwarnings) { if (reportDebugWarnings && mSettings.debugwarnings) {
for (Token *tok = tokens; tok; tok = tok->next()) { for (Token *tok = tokens; tok; tok = tok->next()) {
if (tok->str() == "auto" && !tok->valueType()) if (tok->str() == "auto" && !tok->valueType()) {
if (Token::Match(tok->next(), "%name% ; %name% = [") && isLambdaCaptureList(tok->tokAt(5)))
continue;
if (Token::Match(tok->next(), "%name% { [") && isLambdaCaptureList(tok->tokAt(3)))
continue;
debugMessage(tok, "autoNoType", "auto token with no type."); debugMessage(tok, "autoNoType", "auto token with no type.");
}
} }
} }