* Partial fix for #9384 varid 0 with lamba * Format * Undo * Undo * Partial fix for #9384 varid 0 with lambda (II)
This commit is contained in:
parent
4c85ac0d7b
commit
d1f740a289
|
@ -3512,7 +3512,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::map<std::stri
|
|||
if (Token::Match(tok2, "> %name% )")) {
|
||||
if (Token::Match(tok2->linkAt(2)->previous(), "if|for|while ("))
|
||||
return false;
|
||||
if (!Token::Match(tok2->linkAt(2)->previous(), "%name% ("))
|
||||
if (!Token::Match(tok2->linkAt(2)->previous(), "%name%|] ("))
|
||||
return false;
|
||||
}
|
||||
} else if (Token::Match(tok2, "&|&&")) {
|
||||
|
@ -5232,6 +5232,14 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
|
|||
// Link < with >
|
||||
createLinks2();
|
||||
|
||||
if (mTimerResults) {
|
||||
Timer t("Tokenizer::tokenize::setVarId (2)", mSettings->showtime, mTimerResults);
|
||||
setVarId();
|
||||
}
|
||||
else {
|
||||
setVarId();
|
||||
}
|
||||
|
||||
// Mark C++ casts
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "const_cast|dynamic_cast|reinterpret_cast|static_cast <") && Token::simpleMatch(tok->linkAt(1), "> (")) {
|
||||
|
|
|
@ -2636,7 +2636,7 @@ private:
|
|||
{
|
||||
const char code[] = "auto g = [](std::function<void()> p) {};\n";
|
||||
const char exp[] = "1: auto g@1 ; g@1 = [ ] ( std :: function < void ( ) > p@2 ) { } ;\n";
|
||||
TODO_ASSERT_EQUALS(exp, "1: auto g@1 ; g@1 = [ ] ( std :: function < void ( ) > p ) { } ;\n", tokenize(code));
|
||||
ASSERT_EQUALS(exp, tokenize(code));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue