Fix 9740: FP accessMoved related to designated initialization (#3644)
This commit is contained in:
parent
cc24d6fcef
commit
d69257e8cd
|
@ -803,7 +803,14 @@ static void compileTerm(Token *&tok, AST_state& state)
|
|||
if (state.op.empty() || Token::Match(tok->previous(), "[{,]") || Token::Match(tok->tokAt(-2), "%name% (")) {
|
||||
if (Token::Match(tok, "{ !!}")) {
|
||||
Token *const end = tok->link();
|
||||
compileUnaryOp(tok, state, compileExpression);
|
||||
if (Token::Match(tok, "{ . %name% =|{")) {
|
||||
const int inArrayAssignment = state.inArrayAssignment;
|
||||
state.inArrayAssignment = 1;
|
||||
compileBinOp(tok, state, compileExpression);
|
||||
state.inArrayAssignment = inArrayAssignment;
|
||||
} else {
|
||||
compileUnaryOp(tok, state, compileExpression);
|
||||
}
|
||||
if (precedes(tok,end))
|
||||
tok = end;
|
||||
} else {
|
||||
|
|
|
@ -6107,6 +6107,7 @@ private:
|
|||
ASSERT_EQUALS("a0{,( \"\"abc12:?,", testAst("a(0, {{\"\", (abc) ? 1 : 2}});"));
|
||||
ASSERT_EQUALS("a0{,( \'\'abc12:?,", testAst("a(0, {{\'\', (abc) ? 1 : 2}});"));
|
||||
ASSERT_EQUALS("x12,{34,{,{56,{78,{,{,{=", testAst("x = { { {1,2}, {3,4} }, { {5,6}, {7,8} } };"));
|
||||
ASSERT_EQUALS("Sa.stdmove::s(=b.1=,{(", testAst("S({.a = std::move(s), .b = 1})"));
|
||||
|
||||
// struct initialization hang
|
||||
ASSERT_EQUALS("sbar.1{,{(={= forfieldfield++;;(",
|
||||
|
|
Loading…
Reference in New Issue