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() == ")")
|
if (tok2->str() == ")")
|
||||||
return tok2->previous()->str() == "*" ||
|
return tok2->previous()->str() == "*" ||
|
||||||
(Token::Match(tok2, ") %any%") &&
|
(Token::Match(tok2, ") %any%") &&
|
||||||
(!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:]")));
|
(!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:.]")));
|
||||||
if (!Token::Match(tok2, "%var%|*|&|::"))
|
if (!Token::Match(tok2, "%var%|*|&|::"))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10378,6 +10378,7 @@ private:
|
||||||
testAst("x = ((a[i]).f)();", true));
|
testAst("x = ((a[i]).f)();", true));
|
||||||
ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];"));
|
ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];"));
|
||||||
ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;"));
|
ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;"));
|
||||||
|
ASSERT_EQUALS("abc.=", testAst("a = (b).c;"));
|
||||||
|
|
||||||
// casts
|
// casts
|
||||||
ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));
|
ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));
|
||||||
|
|
Loading…
Reference in New Issue