Fix AST cyclic dependency [cppcheckError] 3 (#3953)
This commit is contained in:
parent
d57d536f01
commit
11cbb2eb00
|
@ -814,7 +814,7 @@ static void compileTerm(Token *&tok, AST_state& state)
|
||||||
state.op.push(tok);
|
state.op.push(tok);
|
||||||
if (Token::Match(tok, "%name% <") && tok->linkAt(1))
|
if (Token::Match(tok, "%name% <") && tok->linkAt(1))
|
||||||
tok = tok->linkAt(1);
|
tok = tok->linkAt(1);
|
||||||
else if (Token::Match(tok, "%name% ...") || (state.op.size() == 1 && state.depth == 0 && Token::Match(tok->tokAt(-2), ") ( %name% ) =")))
|
else if (Token::Match(tok, "%name% ...") || (state.op.size() == 1 && state.depth == 0 && Token::Match(tok->tokAt(-3), "!!& ) ( %name% ) =")))
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
if (Token::Match(tok, "%str%")) {
|
if (Token::Match(tok, "%str%")) {
|
||||||
|
|
|
@ -6222,6 +6222,7 @@ private:
|
||||||
ASSERT_EQUALS("x0=a, stdtie::a(x=", testAst("int x = 0, a; std::tie(a) = x;\n"));
|
ASSERT_EQUALS("x0=a, stdtie::a(x=", testAst("int x = 0, a; std::tie(a) = x;\n"));
|
||||||
ASSERT_EQUALS("tmpa*=a*b*=,b*tmp=,", testAst("{ ((tmp) = (*a)), ((*a) = (*b)), ((*b) = (tmp)); }"));
|
ASSERT_EQUALS("tmpa*=a*b*=,b*tmp=,", testAst("{ ((tmp) = (*a)), ((*a) = (*b)), ((*b) = (tmp)); }"));
|
||||||
ASSERT_EQUALS("a(*v=", testAst("(*(volatile unsigned int *)(a) = (v));"));
|
ASSERT_EQUALS("a(*v=", testAst("(*(volatile unsigned int *)(a) = (v));"));
|
||||||
|
ASSERT_EQUALS("i(j=", testAst("(int&)(i) = j;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void astunaryop() { // unary operators
|
void astunaryop() { // unary operators
|
||||||
|
|
Loading…
Reference in New Issue