Commit 69969bef authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Fixed possible crash on constructor completion

When constructor completion was attempted on a base class specified in a
class declaration, a null pointer reference would occur.

Task-number: QTCREATORBUG-321
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent e106e218
......@@ -1069,7 +1069,8 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi
if (doc->parse(Document::ParseDeclaration)) {
doc->check();
if (SimpleDeclarationAST *sd = doc->translationUnit()->ast()->asSimpleDeclaration()) {
if (sd->declarators->declarator->postfix_declarators
if (sd->declarators &&
sd->declarators->declarator->postfix_declarators
&& sd->declarators->declarator->postfix_declarators->asFunctionDeclarator()) {
autocompleteSignature = true;
}
......
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