Fixed #5736 (AST: proper handling of 'a=(b).c;')

This commit is contained in:
Daniel Marjamäki 2014-04-27 18:03:50 +02:00
parent 9f2e37da37
commit d279f3fb41
2 changed files with 2 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;"));