aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/ResolveExpression.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <[email protected]>2010-05-12 15:34:00 +0200
committerRoberto Raggi <[email protected]>2010-05-14 13:55:22 +0200
commit1f3ce81061e9e233cd6db38c7b147f2b6c4433c8 (patch)
treed35f7e80706f27cd50470d22a4dc7c7b182a5059 /src/libs/cplusplus/ResolveExpression.cpp
parent31b632d6fb9c418b2b9b339ef30e3f2c2d109350 (diff)
Check the member access operator before trying to resolve the base expression.
Diffstat (limited to 'src/libs/cplusplus/ResolveExpression.cpp')
-rw-r--r--src/libs/cplusplus/ResolveExpression.cpp19
1 files 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;