From e2b2fc26842cc9353a0e059bc3fc875e62a94654 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:48:20 +0100 Subject: [PATCH] Fix #10946 Debug warning: autoNoType with lambda (#4824) --- lib/symboldatabase.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index c17b03d6d..19272cd55 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -7204,8 +7204,13 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to if (reportDebugWarnings && mSettings.debugwarnings) { 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."); + } } }