Fixed #5891 (AST: wrong ast generated for 'x = (int)(double(123)*i);')
This commit is contained in:
parent
eefaddf980
commit
7107286be6
|
@ -453,7 +453,7 @@ static bool iscast(const Token *tok)
|
|||
if (!Token::Match(tok2, "%var%|*|&|::"))
|
||||
return false;
|
||||
|
||||
if (tok2->isStandardType())
|
||||
if (tok2->isStandardType() && tok2->next()->str() != "(")
|
||||
type = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -8547,6 +8547,7 @@ private:
|
|||
ASSERT_EQUALS("afoveon_avgimage((foveon_avgimage((+=", testAst("a = foveon_avg(((short(*)[4]) image)) + foveon_avg(((short(*)[4]) image));"));
|
||||
ASSERT_EQUALS("c(40<<return", testAst("return (long long)c << 40;"));
|
||||
ASSERT_EQUALS("ab-(=", testAst("a = ((int)-b)")); // Multiple subsequent unary operators (cast and -)
|
||||
ASSERT_EQUALS("xdouble123(i*(=", testAst("x = (int)(double(123)*i);"));
|
||||
}
|
||||
|
||||
void astlambda() const {
|
||||
|
|
Loading…
Reference in New Issue