Fixed bad ast (wrong result from iscast())
This commit is contained in:
parent
c514818b65
commit
388b5118df
|
@ -445,7 +445,7 @@ static bool iscast(const Token *tok)
|
||||||
if (Token::Match(tok->link(), ") }|)|]|;"))
|
if (Token::Match(tok->link(), ") }|)|]|;"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~]"))
|
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~!]"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Token::Match(tok->previous(), "= ( %name% ) {") && tok->next()->varId() == 0)
|
if (Token::Match(tok->previous(), "= ( %name% ) {") && tok->next()->varId() == 0)
|
||||||
|
|
|
@ -7808,6 +7808,8 @@ private:
|
||||||
|
|
||||||
ASSERT_EQUALS("yz.(return", testAst("return (x)(y).z;"));
|
ASSERT_EQUALS("yz.(return", testAst("return (x)(y).z;"));
|
||||||
|
|
||||||
|
ASSERT_EQUALS("fon!(restoring01:?,(", testAst("f((long) !on, restoring ? 0 : 1);"));
|
||||||
|
|
||||||
// not cast
|
// not cast
|
||||||
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
|
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
|
||||||
ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
|
ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
|
||||||
|
|
Loading…
Reference in New Issue