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; return retBinding;
} }
} }
} } else if (accessOp == T_DOT) {
if (replacedDotOperator) {
if (replacedDotOperator && accessOp == T_DOT) { if (PointerType *ptrTy = ty->asPointerType()) {
if (PointerType *ptrTy = ty->asPointerType()) { // replace . with ->
ty = ptrTy->elementType(); ty = ptrTy->elementType();
*replacedDotOperator = true; *replacedDotOperator = true;
}
} }
}
if (ClassOrNamespace *binding = findClass(ty, scope)) if (ClassOrNamespace *binding = findClass(ty, scope))
return binding; return binding;
}
} }
return 0; return 0;