From 4fb4705791bf4ef8e5583f4b7db74623b35d5b5c Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Fri, 23 Oct 2009 14:53:44 +0200
Subject: [PATCH] Resolve the conditional and new-expressions

---
 src/libs/cplusplus/ResolveExpression.cpp | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp
index 7c9eedebd56..aff38db4b3f 100644
--- a/src/libs/cplusplus/ResolveExpression.cpp
+++ b/src/libs/cplusplus/ResolveExpression.cpp
@@ -286,9 +286,14 @@ bool ResolveExpression::visit(ConditionAST *)
     return false;
 }
 
-bool ResolveExpression::visit(ConditionalExpressionAST *)
+bool ResolveExpression::visit(ConditionalExpressionAST *ast)
 {
-    // nothing to do.
+    if (ast->left_expression)
+        accept(ast->left_expression);
+
+    else if (ast->right_expression)
+        accept(ast->right_expression);
+
     return false;
 }
 
@@ -300,7 +305,8 @@ bool ResolveExpression::visit(CppCastExpressionAST *ast)
 
 bool ResolveExpression::visit(DeleteExpressionAST *)
 {
-    // nothing to do.
+    FullySpecifiedType ty(control()->voidType());
+    addResult(ty);
     return false;
 }
 
@@ -310,8 +316,15 @@ bool ResolveExpression::visit(ArrayInitializerAST *)
     return false;
 }
 
-bool ResolveExpression::visit(NewExpressionAST *)
+bool ResolveExpression::visit(NewExpressionAST *ast)
 {
+    if (ast->new_type_id) {
+        Scope *scope = _context.expressionDocument()->globalSymbols();
+        FullySpecifiedType ty = sem.check(ast->new_type_id->type_specifier, scope);
+        ty = sem.check(ast->new_type_id->ptr_operators, ty, scope);
+        FullySpecifiedType ptrTy(control()->pointerType(ty));
+        addResult(ptrTy);
+    }
     // nothing to do.
     return false;
 }
-- 
GitLab