forked from qt-creator/qt-creator
C++11: More (expression-list) or brace-init-list.
This time in the 'new' expression. Changed it to make
new C(1, abc...) and new C{1, abc}
work.
Change-Id: I7232798fd083b653ee04ef9ede386d6536133e16
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -663,13 +663,14 @@ bool CheckSymbols::visit(NewExpressionAST *ast)
|
||||
if (binding && nameAST) {
|
||||
int arguments = 0;
|
||||
if (ast->new_initializer) {
|
||||
if (ExpressionAST *expr = ast->new_initializer->expression) {
|
||||
while (BinaryExpressionAST *binExpr = expr->asBinaryExpression()) {
|
||||
expr = binExpr->right_expression;
|
||||
++arguments;
|
||||
}
|
||||
ExpressionListAST *list = 0;
|
||||
if (ExpressionListParenAST *exprListParen = ast->new_initializer->asExpressionListParen()) {
|
||||
list = exprListParen->expression_list;
|
||||
} else if (BracedInitializerAST *braceInit = ast->new_initializer->asBracedInitializer()) {
|
||||
list = braceInit->expression_list;
|
||||
}
|
||||
|
||||
for (ExpressionListAST *it = list; it; it = it->next)
|
||||
++arguments;
|
||||
}
|
||||
|
||||
Scope *scope = enclosingScope();
|
||||
|
||||
Reference in New Issue
Block a user