forked from qt-creator/qt-creator
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:
@@ -721,7 +721,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
||||
continue; // skip using namespace directives
|
||||
else if (! id->match(s->identifier()))
|
||||
continue;
|
||||
else if (s->name()->isQualifiedNameId())
|
||||
else if (s->name() && s->name()->isQualifiedNameId())
|
||||
continue; // skip qualified ids.
|
||||
|
||||
if (Q_UNLIKELY(debug)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user