parent
2ff9e60650
commit
fa03f49d2b
|
@ -5249,7 +5249,7 @@ void Tokenizer::createLinks2()
|
|||
} else if (token->str() == "<" &&
|
||||
((token->previous() && (token->previous()->isTemplate() ||
|
||||
(token->previous()->isName() && !token->previous()->varId()) ||
|
||||
(token->strAt(-1) == "]" && !Token::Match(token->linkAt(-1)->previous(), "%name%|)")))) ||
|
||||
(token->strAt(-1) == "]" && (!Token::Match(token->linkAt(-1)->previous(), "%name%|)") || token->linkAt(-1)->previous()->isKeyword())))) ||
|
||||
Token::Match(token->next(), ">|>>"))) {
|
||||
type.push(token);
|
||||
if (token->previous()->str() == "template")
|
||||
|
|
|
@ -3515,6 +3515,22 @@ private:
|
|||
ASSERT_EQUALS(true, tok1->link() == tok2);
|
||||
ASSERT_EQUALS(true, tok2->link() == tok1);
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "void f() {\n"
|
||||
" auto g = [] <typename U> () {\n"
|
||||
" return [] <typename T> () {};\n"
|
||||
" };\n"
|
||||
"}\n";
|
||||
errout.str("");
|
||||
Tokenizer tokenizer(&settings0, this);
|
||||
std::istringstream istr(code);
|
||||
ASSERT(tokenizer.tokenize(istr, "test.cpp"));
|
||||
const Token* tok1 = Token::findsimplematch(tokenizer.tokens(), "< T");
|
||||
const Token* tok2 = Token::findsimplematch(tok1, "> (");
|
||||
ASSERT_EQUALS(true, tok1->link() == tok2);
|
||||
ASSERT_EQUALS(true, tok2->link() == tok1);
|
||||
}
|
||||
}
|
||||
|
||||
void simplifyString() {
|
||||
|
|
Loading…
Reference in New Issue