More general fix to #4187 (False positive: Variable inside a lambda is reported as uninitialized)
Travis: Problems with matchcompiler.py
This commit is contained in:
parent
511f8a4c1f
commit
0076ebe08d
|
@ -5007,8 +5007,10 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
|
|||
if (isCPP() && Token::Match(tok2, "[(,] [")) {
|
||||
// lambda function at tok2->next()
|
||||
// find start of lambda body
|
||||
Token * lambdaBody = Token::findsimplematch(tok2, "{", tok->link());
|
||||
if (lambdaBody && lambdaBody->link())
|
||||
Token * lambdaBody = tok2;
|
||||
while (lambdaBody && lambdaBody != tok2->link() && lambdaBody->str() != "{")
|
||||
lambdaBody = lambdaBody->next();
|
||||
if (lambdaBody && lambdaBody != tok2->link() && lambdaBody->link())
|
||||
simplifyVarDecl(lambdaBody, lambdaBody->link(), only_k_r_fpar);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue