C++: Check for Function::name() before using it

Lambdas do not have a name.

Change-Id: Ifda4816c62dcfe19bdbb1649dc1caf408e056b37
Task-number: QTCREATORBUG-12686
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-07-17 11:39:16 +02:00
parent 67a7696e60
commit dc59d28736
5 changed files with 59 additions and 54 deletions

View File

@@ -350,13 +350,15 @@ void ResolveExpression::thisObject()
FullySpecifiedType ptrTy(control()->pointerType(classTy));
addResult(ptrTy, fun->enclosingScope());
break;
} else if (const QualifiedNameId *q = fun->name()->asQualifiedNameId()) {
if (q->base()) {
FullySpecifiedType classTy(control()->namedType(q->base()));
FullySpecifiedType ptrTy(control()->pointerType(classTy));
addResult(ptrTy, fun->enclosingScope());
} else if (const Name *name = fun->name()) {
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
if (q->base()) {
FullySpecifiedType classTy(control()->namedType(q->base()));
FullySpecifiedType ptrTy(control()->pointerType(classTy));
addResult(ptrTy, fun->enclosingScope());
}
break;
}
break;
}
}
}