Fixed #8462 (AST: no ast created for 'e = { std::move(address),httpPort, (httpsPort) };')
This commit is contained in:
parent
c76b593467
commit
210b921062
|
@ -401,6 +401,12 @@ static bool iscast(const Token *tok)
|
|||
if (Token::Match(tok, "( (| typeof (") && Token::Match(tok->link(), ") %num%"))
|
||||
return true;
|
||||
|
||||
if (Token::Match(tok->link(), ") }|)|]"))
|
||||
return false;
|
||||
|
||||
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~]"))
|
||||
return false;
|
||||
|
||||
if (Token::Match(tok->previous(), "= ( %name% ) {") && tok->next()->varId() == 0)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -8324,6 +8324,7 @@ private:
|
|||
ASSERT_EQUALS("s0[L.2[x={=", testAst("s = { [0].L[2] = x};"));
|
||||
ASSERT_EQUALS("ac.0={(=", testAst("a = (b){.c=0,};")); // <- useless comma
|
||||
ASSERT_EQUALS("xB[1y.z.1={(&=,{={=", testAst("x = { [B] = {1, .y = &(struct s) { .z=1 } } };"));
|
||||
ASSERT_EQUALS("xab,c,{=", testAst("x={a,b,(c)};"));
|
||||
|
||||
// struct initialization hang
|
||||
ASSERT_EQUALS("sbar.1{,{(={= fcmd( forfieldfield++;;(",
|
||||
|
|
Loading…
Reference in New Issue