Fixed #8921 (Broken AST - mem = (void*)(new char))

This commit is contained in:
Daniel Marjamäki 2019-05-11 15:50:30 +02:00
parent 45d874bf75
commit 1e2f1bac1f
2 changed files with 3 additions and 1 deletions

View File

@ -403,7 +403,7 @@ static bool iscast(const Token *tok)
if (Token::Match(tok, "( (| typeof (") && Token::Match(tok->link(), ") %num%"))
return true;
if (Token::Match(tok->link(), ") }|)|]"))
if (Token::Match(tok->link(), ") }|)|]|;"))
return false;
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~]"))

View File

@ -7395,6 +7395,8 @@ private:
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
ASSERT_EQUALS("abc::(=", testAst("a = (b::c)();"));
ASSERT_EQUALS("pcharnew(=", testAst("p = (void *)(new char);"));
}
void astlambda() {