Fixed #5736 (AST: proper handling of 'a=(b).c;')
This commit is contained in:
parent
9f2e37da37
commit
d279f3fb41
|
@ -396,7 +396,7 @@ static bool iscast(const Token *tok)
|
|||
if (tok2->str() == ")")
|
||||
return tok2->previous()->str() == "*" ||
|
||||
(Token::Match(tok2, ") %any%") &&
|
||||
(!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:]")));
|
||||
(!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:.]")));
|
||||
if (!Token::Match(tok2, "%var%|*|&|::"))
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -10378,6 +10378,7 @@ private:
|
|||
testAst("x = ((a[i]).f)();", true));
|
||||
ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];"));
|
||||
ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;"));
|
||||
ASSERT_EQUALS("abc.=", testAst("a = (b).c;"));
|
||||
|
||||
// casts
|
||||
ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));
|
||||
|
|
Loading…
Reference in New Issue