Check the member access operator before trying to resolve the base expression.

This commit is contained in:
Roberto Raggi
2010-05-12 15:34:00 +02:00
parent 31b632d6fb
commit 1f3ce81061

View File

@@ -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;