forked from qt-creator/qt-creator
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: Christian Kamm <christian.d.kamm@nokia.com>
(cherry picked from commit 69969bef43
)
This commit is contained in:
@@ -1060,7 +1060,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user