parent
6ea88c2758
commit
22e67d3534
|
@ -971,6 +971,10 @@ static void compilePrecedence2(Token *&tok, AST_state& state)
|
|||
else
|
||||
compileUnaryOp(tok, state, compileExpression);
|
||||
tok = tok2->link()->next();
|
||||
} else if (Token::simpleMatch(tok, "( {") && Token::simpleMatch(tok->linkAt(1)->previous(), "; } )") && !Token::Match(tok->previous(), "%name% (")) {
|
||||
state.op.push(tok->next());
|
||||
tok = tok->link()->next();
|
||||
continue;
|
||||
} else if (tok->str() == "(" && (!iscast(tok, state.cpp) || Token::Match(tok->previous(), "if|while|for|switch|catch"))) {
|
||||
Token* tok2 = tok;
|
||||
tok = tok->next();
|
||||
|
|
|
@ -6266,6 +6266,7 @@ private:
|
|||
ASSERT_EQUALS("fori10=i{;;( i--", testAst("for (i=10;i;({i--;}) ) {}"));
|
||||
ASSERT_EQUALS("c{1{,{2.3f{,(",
|
||||
testAst("c({{}, {1}}, {2.3f});"));
|
||||
ASSERT_EQUALS("x{{= e0= assert0(", testAst("x = {({ int e = 0; assert(0); e; })};"));
|
||||
|
||||
// function pointer
|
||||
TODO_ASSERT_EQUALS("todo", "va_argapvoid((,(*0=", testAst("*va_arg(ap, void(**) ()) = 0;"));
|
||||
|
|
Loading…
Reference in New Issue