C++: fix code completion when pointer's type is a typedef

Task-number: QTCREATORBUG-8488

Change-Id: I6f11173452df3e1611fba1c04da17e7428f34e9e
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Przemyslaw Gorszkowski
2012-12-28 22:28:56 +01:00
committed by hjk
parent 4e8b5c6dfc
commit f5b0fcfb5d

View File

@@ -908,6 +908,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
foreach (const LookupItem &r, baseResults) {
FullySpecifiedType ty = r.type().simplified();
FullySpecifiedType originalType = ty;
Scope *scope = r.scope();
#ifdef DEBUG_LOOKUP
@@ -922,8 +923,11 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
#endif // DEBUG_LOOKUP
if (accessOp == T_ARROW) {
if (PointerType *ptrTy = ty->asPointerType()) {
if (ClassOrNamespace *binding = findClass(ptrTy->elementType(), scope))
if (PointerType *ptrTy = originalType->asPointerType()) {
FullySpecifiedType type = ptrTy->elementType();
if (! ty->isPointerType())
type = ty;
if (ClassOrNamespace *binding = findClass(type, scope))
return binding;
} else if (ClassOrNamespace *binding = findClass(ty, scope)) {