AST: Fixed wrong AST for cast '(std::vector<int>&&)s->second'
This commit is contained in:
parent
e9937e3acb
commit
e4937ed621
|
@ -526,8 +526,6 @@ static bool iscast(const Token *tok)
|
||||||
tok2 = tok2->link()->next();
|
tok2 = tok2->link()->next();
|
||||||
|
|
||||||
if (tok2->str() == ")") {
|
if (tok2->str() == ")") {
|
||||||
if (Token::Match(tok2->previous(), "&|&& )"))
|
|
||||||
return true;
|
|
||||||
if (Token::simpleMatch(tok2, ") (") && Token::simpleMatch(tok2->linkAt(1), ") ."))
|
if (Token::simpleMatch(tok2, ") (") && Token::simpleMatch(tok2->linkAt(1), ") ."))
|
||||||
return true;
|
return true;
|
||||||
return type || tok2->strAt(-1) == "*" || Token::simpleMatch(tok2, ") ~") ||
|
return type || tok2->strAt(-1) == "*" || Token::simpleMatch(tok2, ") ~") ||
|
||||||
|
@ -535,7 +533,11 @@ static bool iscast(const Token *tok)
|
||||||
!tok2->next()->isOp() &&
|
!tok2->next()->isOp() &&
|
||||||
!Token::Match(tok2->next(), "[[]);,?:.]"));
|
!Token::Match(tok2->next(), "[[]);,?:.]"));
|
||||||
}
|
}
|
||||||
if (!Token::Match(tok2, "%name%|*|&|::"))
|
|
||||||
|
if (Token::Match(tok2, "&|&& )"))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!Token::Match(tok2, "%name%|*|::"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tok2->isStandardType() && (tok2->next()->str() != "(" || Token::Match(tok2->next(), "( * *| )")))
|
if (tok2->isStandardType() && (tok2->next()->str() != "(" || Token::Match(tok2->next(), "( * *| )")))
|
||||||
|
|
|
@ -7658,6 +7658,7 @@ private:
|
||||||
ASSERT_EQUALS("a1(2+=",testAst("a=(t)1+2;"));
|
ASSERT_EQUALS("a1(2+=",testAst("a=(t)1+2;"));
|
||||||
ASSERT_EQUALS("a1(2+=",testAst("a=(t*)1+2;"));
|
ASSERT_EQUALS("a1(2+=",testAst("a=(t*)1+2;"));
|
||||||
ASSERT_EQUALS("a1(2+=",testAst("a=(t&)1+2;"));
|
ASSERT_EQUALS("a1(2+=",testAst("a=(t&)1+2;"));
|
||||||
|
ASSERT_EQUALS("a1(2+=",testAst("a=(t&&)1+2;"));
|
||||||
ASSERT_EQUALS("ab::r&c(=", testAst("a::b& r = (a::b&)c;")); // #5261
|
ASSERT_EQUALS("ab::r&c(=", testAst("a::b& r = (a::b&)c;")); // #5261
|
||||||
ASSERT_EQUALS("ab10:?=", testAst("a=(b)?1:0;"));
|
ASSERT_EQUALS("ab10:?=", testAst("a=(b)?1:0;"));
|
||||||
ASSERT_EQUALS("ac5[new(=", testAst("a = (b*)(new c[5]);")); // #8786
|
ASSERT_EQUALS("ac5[new(=", testAst("a = (b*)(new c[5]);")); // #8786
|
||||||
|
|
Loading…
Reference in New Issue