diff options
Diffstat (limited to 'src/shared/cplusplus/CheckExpression.cpp')
-rw-r--r-- | src/shared/cplusplus/CheckExpression.cpp | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/src/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp index 02263d6b82..f8da07534c 100644 --- a/src/shared/cplusplus/CheckExpression.cpp +++ b/src/shared/cplusplus/CheckExpression.cpp @@ -86,7 +86,7 @@ ExpressionAST *CheckExpression::switchExpression(ExpressionAST *expression) return previousExpression; } -FullySpecifiedType CheckExpression::switchFullySpecifiedType(FullySpecifiedType type) +FullySpecifiedType CheckExpression::switchFullySpecifiedType(const FullySpecifiedType &type) { FullySpecifiedType previousType = _fullySpecifiedType; _fullySpecifiedType = type; @@ -100,14 +100,6 @@ Scope *CheckExpression::switchScope(Scope *scope) return previousScope; } -bool CheckExpression::visit(ExpressionListAST *ast) -{ - for (ExpressionListAST *it = ast; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); - } - return false; -} - bool CheckExpression::visit(BinaryExpressionAST *ast) { FullySpecifiedType leftExprTy = semantic()->check(ast->left_expression, _scope); @@ -127,8 +119,8 @@ bool CheckExpression::visit(CastExpressionAST *ast) bool CheckExpression::visit(ConditionAST *ast) { - FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier, _scope); - Name *name = 0; + FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier_list, _scope); + const Name *name = 0; FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(), _scope, &name); Declaration *decl = control()->newDeclaration(ast->declarator->firstToken(), name); @@ -161,7 +153,7 @@ bool CheckExpression::visit(DeleteExpressionAST *ast) bool CheckExpression::visit(ArrayInitializerAST *ast) { for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + FullySpecifiedType exprTy = semantic()->check(it->value, _scope); } return false; } @@ -206,17 +198,19 @@ bool CheckExpression::visit(NewExpressionAST *ast) { if (ast->new_placement) { for (ExpressionListAST *it = ast->new_placement->expression_list; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + FullySpecifiedType exprTy = semantic()->check(it->value, _scope); } } FullySpecifiedType typeIdTy = semantic()->check(ast->type_id, _scope); if (ast->new_type_id) { - FullySpecifiedType ty = semantic()->check(ast->new_type_id->type_specifier, _scope); + FullySpecifiedType ty = semantic()->check(ast->new_type_id->type_specifier_list, _scope); - for (NewArrayDeclaratorAST *it = ast->new_type_id->new_array_declarators; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + for (NewArrayDeclaratorListAST *it = ast->new_type_id->new_array_declarator_list; it; it = it->next) { + if (NewArrayDeclaratorAST *declarator = it->value) { + FullySpecifiedType exprTy = semantic()->check(declarator->expression, _scope); + } } } @@ -239,7 +233,7 @@ bool CheckExpression::visit(TypenameCallExpressionAST *ast) (void) semantic()->check(ast->name, _scope); for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + FullySpecifiedType exprTy = semantic()->check(it->value, _scope); (void) exprTy; } return false; @@ -247,9 +241,9 @@ bool CheckExpression::visit(TypenameCallExpressionAST *ast) bool CheckExpression::visit(TypeConstructorCallAST *ast) { - FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier, _scope); + FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier_list, _scope); for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + FullySpecifiedType exprTy = semantic()->check(it->value, _scope); } return false; } @@ -257,8 +251,8 @@ bool CheckExpression::visit(TypeConstructorCallAST *ast) bool CheckExpression::visit(PostfixExpressionAST *ast) { FullySpecifiedType exprTy = semantic()->check(ast->base_expression, _scope); - for (PostfixAST *fx = ast->postfix_expressions; fx; fx = fx->next) { - accept(fx); // ### not exactly. + for (PostfixListAST *it = ast->postfix_expression_list; it; it = it->next) { + accept(it->value); // ### not exactly. } return false; } @@ -307,9 +301,8 @@ bool CheckExpression::visit(ThrowExpressionAST *ast) bool CheckExpression::visit(TypeIdAST *ast) { - FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier, _scope); - FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(), - _scope); + FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier_list, _scope); + FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(), _scope); _fullySpecifiedType = declTy; return false; } @@ -322,7 +315,7 @@ bool CheckExpression::visit(UnaryExpressionAST *ast) bool CheckExpression::visit(QtMethodAST *ast) { - Name *name = 0; + const Name *name = 0; Scope dummy; FullySpecifiedType methTy = semantic()->check(ast->declarator, FullySpecifiedType(), &dummy, &name); @@ -350,7 +343,7 @@ bool CheckExpression::visit(CompoundLiteralAST *ast) bool CheckExpression::visit(CallAST *ast) { for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { - FullySpecifiedType exprTy = semantic()->check(it->expression, _scope); + FullySpecifiedType exprTy = semantic()->check(it->value, _scope); } return false; } @@ -374,10 +367,10 @@ bool CheckExpression::visit(MemberAccessAST *ast) bool CheckExpression::visit(ObjCMessageExpressionAST *ast) { - semantic()->check(ast->receiver_expression, _scope); + (void) semantic()->check(ast->receiver_expression, _scope); (void) semantic()->check(ast->selector, _scope); - accept(ast->argument_list); + accept(ast->argument_list); // ### not necessary. return false; } |