From 1f3ce81061e9e233cd6db38c7b147f2b6c4433c8 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Wed, 12 May 2010 15:34:00 +0200
Subject: [PATCH] Check the member access operator before trying to resolve the
 base expression.

---
 src/libs/cplusplus/ResolveExpression.cpp | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp
index 19d8c611d25..7a2fca86ad5 100644
--- a/src/libs/cplusplus/ResolveExpression.cpp
+++ b/src/libs/cplusplus/ResolveExpression.cpp
@@ -609,17 +609,18 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
                         return retBinding;
                 }
             }
-        }
-
-        if (replacedDotOperator && accessOp == T_DOT) {
-            if (PointerType *ptrTy = ty->asPointerType()) {
-                ty = ptrTy->elementType();
-                *replacedDotOperator = true;
+        } else if (accessOp == T_DOT) {
+            if (replacedDotOperator) {
+                if (PointerType *ptrTy = ty->asPointerType()) {
+                    // replace . with ->
+                    ty = ptrTy->elementType();
+                    *replacedDotOperator = true;
+                }
             }
-        }
 
-        if (ClassOrNamespace *binding = findClass(ty, scope))
-            return binding;
+            if (ClassOrNamespace *binding = findClass(ty, scope))
+                return binding;
+        }
     }
 
     return 0;
-- 
GitLab