Merge pull request #5147 from chrchr-github/chr_astregr

Fix AST regression
This commit is contained in:
chrchr-github 2023-06-16 22:47:47 +02:00 committed by GitHub
commit 62dfa8877c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -5251,7 +5251,7 @@ void Tokenizer::createLinks2()
} else if (token->str() == "<" &&
((token->previous() && (token->previous()->isTemplate() ||
(token->previous()->isName() && !token->previous()->varId()) ||
token->strAt(-1) == "]")) ||
(token->strAt(-1) == "]" && !Token::Match(token->linkAt(-1)->previous(), "%name%|)")))) ||
Token::Match(token->next(), ">|>>"))) {
type.push(token);
if (token->previous()->str() == "template")

View File

@ -5955,6 +5955,7 @@ private:
ASSERT_EQUALS("x00throw:?return", testAst("return x ? 0 : throw 0;")); // #9768
ASSERT_EQUALS("val0<1throwval:?return", testAst("return val < 0 ? throw 1 : val;")); // #8526
ASSERT_EQUALS("ix0<00throw:?=", testAst("int i = x < 0 ? 0 : throw 0;"));
ASSERT_EQUALS("pa[pb[<1-pa[pb[>:?return", testAst("return p[a] < p[b] ? -1 : p[a] > p[b];"));
ASSERT_EQUALS("a\"\"=", testAst("a=\"\""));
ASSERT_EQUALS("a\'\'=", testAst("a=\'\'"));