AST: fixed cast for 'return (long long)c << 40;'
This commit is contained in:
parent
e2136adf5b
commit
0ab7abded1
|
@ -435,7 +435,7 @@ static bool iscast(const Token *tok)
|
|||
if (!Token::Match(tok, "( %var%"))
|
||||
return false;
|
||||
|
||||
if (tok->previous() && tok->previous()->isName())
|
||||
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return")
|
||||
return false;
|
||||
|
||||
if (Token::Match(tok, "( (| typeof (") && Token::Match(tok->link(), ") %num%"))
|
||||
|
|
|
@ -10982,7 +10982,7 @@ private:
|
|||
ASSERT_EQUALS("ac-(=", testAst("a = (long)-c;"));
|
||||
ASSERT_EQUALS("ac(=", testAst("a = (some<strange, type>)c;"));
|
||||
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 -)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue