summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/CheckExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus/CheckExpression.cpp')
-rw-r--r--src/shared/cplusplus/CheckExpression.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp
index 8d0bf823e5..08801a5b54 100644
--- a/src/shared/cplusplus/CheckExpression.cpp
+++ b/src/shared/cplusplus/CheckExpression.cpp
@@ -208,13 +208,33 @@ bool CheckExpression::visit(TemplateIdAST *ast)
return false;
}
-bool CheckExpression::visit(NewExpressionAST *)
+bool CheckExpression::visit(NewExpressionAST *ast)
{
- // ### FIXME
- //FullySpecifiedType exprTy = semantic()->check(ast->expression, _scope);
- //FullySpecifiedType typeIdTy = semantic()->check(ast->type_id, _scope);
- // ### process new-typeid
+ if (ast->new_placement) {
+ for (ExpressionListAST *it = ast->new_placement->expression_list; it; it = it->next) {
+ FullySpecifiedType exprTy = semantic()->check(it->expression, _scope);
+ Q_UNUSED(exprTy);
+ }
+ }
+
+ FullySpecifiedType typeIdTy = semantic()->check(ast->type_id, _scope);
+
+ if (ast->new_type_id) {
+ FullySpecifiedType ty = semantic()->check(ast->new_type_id->type_specifier, _scope);
+ Q_UNUSED(ty);
+
+ for (NewArrayDeclaratorAST *it = ast->new_type_id->new_array_declarators; it; it = it->next) {
+ FullySpecifiedType exprTy = semantic()->check(it->expression, _scope);
+ Q_UNUSED(exprTy);
+ }
+ }
+
// ### process new-initializer
+ if (ast->new_initializer) {
+ FullySpecifiedType exprTy = semantic()->check(ast->new_initializer->expression, _scope);
+ Q_UNUSED(exprTy);
+ }
+
return false;
}