diff options
Diffstat (limited to 'src/shared/cplusplus/CheckExpression.cpp')
-rw-r--r-- | src/shared/cplusplus/CheckExpression.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp index 17ac2ebfe9..1f402dca55 100644 --- a/src/shared/cplusplus/CheckExpression.cpp +++ b/src/shared/cplusplus/CheckExpression.cpp @@ -123,9 +123,9 @@ bool CheckExpression::visit(ConditionAST *ast) const Name *name = 0; FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(), _scope, &name); - Declaration *decl = control()->newDeclaration(ast->declarator->firstToken(), name); + Declaration *decl = control()->newDeclaration(semantic()->location(ast->declarator), name); decl->setType(declTy); - _scope->enterSymbol(decl); + _scope->addMember(decl); return false; } @@ -248,15 +248,6 @@ bool CheckExpression::visit(TypeConstructorCallAST *ast) return false; } -bool CheckExpression::visit(PostfixExpressionAST *ast) -{ - FullySpecifiedType exprTy = semantic()->check(ast->base_expression, _scope); - for (PostfixListAST *it = ast->postfix_expression_list; it; it = it->next) { - accept(it->value); // ### not exactly. - } - return false; -} - bool CheckExpression::visit(SizeofExpressionAST *ast) { FullySpecifiedType exprTy = semantic()->check(ast->expression, _scope); @@ -321,10 +312,13 @@ bool CheckExpression::visit(UnaryExpressionAST *ast) bool CheckExpression::visit(QtMethodAST *ast) { + (void) ast; + // ### port this code +#if 0 const Name *name = 0; - Scope dummy; + Scope *dummy = 0; FullySpecifiedType methTy = semantic()->check(ast->declarator, FullySpecifiedType(), - &dummy, &name); + dummy, &name); Function *fty = methTy->asFunctionType(); if (! fty) translationUnit()->warning(ast->firstToken(), "expected a function declarator"); @@ -336,6 +330,7 @@ bool CheckExpression::visit(QtMethodAST *ast) "argument should be anonymous"); } } +#endif return false; } @@ -348,6 +343,7 @@ bool CheckExpression::visit(CompoundLiteralAST *ast) bool CheckExpression::visit(CallAST *ast) { + FullySpecifiedType baseTy = semantic()->check(ast->base_expression, _scope); for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { FullySpecifiedType exprTy = semantic()->check(it->value, _scope); } @@ -356,18 +352,22 @@ bool CheckExpression::visit(CallAST *ast) bool CheckExpression::visit(ArrayAccessAST *ast) { + FullySpecifiedType baseTy = semantic()->check(ast->base_expression, _scope); FullySpecifiedType exprTy = semantic()->check(ast->expression, _scope); return false; } -bool CheckExpression::visit(PostIncrDecrAST *) +bool CheckExpression::visit(PostIncrDecrAST *ast) { + FullySpecifiedType baseTy = semantic()->check(ast->base_expression, _scope); return false; } bool CheckExpression::visit(MemberAccessAST *ast) { - (void) semantic()->check(ast->member_name, _scope); + FullySpecifiedType baseTy = semantic()->check(ast->base_expression, _scope); + const Name *memberName = semantic()->check(ast->member_name, _scope); + (void) memberName; return false; } @@ -388,7 +388,7 @@ bool CheckExpression::visit(ObjCEncodeExpressionAST * /*ast*/) bool CheckExpression::visit(ObjCSelectorExpressionAST *ast) { - if (_scope->isPrototypeScope()) + if (_scope->isFunction()) return false; (void) semantic()->check(ast->selector, _scope); @@ -397,7 +397,7 @@ bool CheckExpression::visit(ObjCSelectorExpressionAST *ast) bool CheckExpression::visit(LambdaExpressionAST *ast) { - if (_scope->isPrototypeScope()) + if (_scope->isFunction()) return false; (void) semantic()->check(ast->statement, _scope); |