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

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 <>
parent e106e218
......@@ -1069,7 +1069,8 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi
if (doc->parse(Document::ParseDeclaration)) {
if (SimpleDeclarationAST *sd = doc->translationUnit()->ast()->asSimpleDeclaration()) {
if (sd->declarators->declarator->postfix_declarators
if (sd->declarators &&
&& sd->declarators->declarator->postfix_declarators->asFunctionDeclarator()) {
autocompleteSignature = true;
Supports Markdown
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