Instiate overloads of operator->().

This commit is contained in:
Roberto Raggi
2010-05-12 16:04:43 +02:00
parent 1f3ce81061
commit 3c6ad0d845
4 changed files with 57 additions and 30 deletions

View File

@@ -603,10 +603,23 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
const OperatorNameId *arrowOp = control()->operatorNameId(OperatorNameId::ArrowOp);
foreach (Symbol *overload, binding->find(arrowOp)) {
FullySpecifiedType overloadTy = overload->type();
if (Function *funTy = overload->type()->asFunctionType()) {
FullySpecifiedType overloadTy = GenTemplateInstance::instantiate(binding->templateId(), overload, control());
Function *instantiatedFunction = overloadTy->asFunctionType();
Q_ASSERT(instantiatedFunction != 0);
if (ClassOrNamespace *retBinding = findClass(overloadTy, overload->scope()))
return retBinding;
FullySpecifiedType retTy = instantiatedFunction->returnType().simplified();
if (PointerType *ptrTy = retTy->asPointerType()) {
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), overload->scope()))
return retBinding;
else if (debug) {
Overview oo;
qDebug() << "no class for:" << oo(ptrTy->elementType());
}
}
}
}
}
} else if (accessOp == T_DOT) {