AST: Fix wrong handling of struct initialization, caused hang
This commit is contained in:
parent
45d2d66df3
commit
d92c529aa6
|
@ -628,6 +628,7 @@ static void compileTerm(Token *&tok, AST_state& state)
|
|||
}
|
||||
} else {
|
||||
state.op.push(tok);
|
||||
tok = tok->tokAt(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8071,6 +8071,11 @@ private:
|
|||
ASSERT_EQUALS("s1a&,{2b&,{,{=", testAst("s = { {1, &a}, {2, &b} };"));
|
||||
TODO_ASSERT_EQUALS("xatoistr({(=", "x{(= atoistr(", testAst("x = (struct X){atoi(str)};"));
|
||||
|
||||
// struct initialization hang
|
||||
ASSERT_EQUALS("sbar1{,{(={= fcmd( forfieldfield++;;(",
|
||||
testAst("struct S s = {.bar = (struct foo) { 1, { } } };\n"
|
||||
"void f(struct cmd *) { for (; field; field++) {} }"));
|
||||
|
||||
// template parentheses: <>
|
||||
ASSERT_EQUALS("stdfabs::m_similarity(numeric_limitsepsilon::(<=return", testAst("return std::fabs(m_similarity) <= numeric_limits<double>::epsilon();")); // #6195
|
||||
|
||||
|
|
Loading…
Reference in New Issue