Commit f5b0fcfb authored by Przemyslaw Gorszkowski's avatar Przemyslaw Gorszkowski Committed by hjk
Browse files

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



Task-number: QTCREATORBUG-8488

Change-Id: I6f11173452df3e1611fba1c04da17e7428f34e9e
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 4e8b5c6d
......@@ -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)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment