C++ function link: The symbol can be unavailable on parser error.

Change-Id: I7a95adcaafff5ff845ae0fdef5bea8c3846a6ffe
Reviewed-on: http://codereview.qt.nokia.com/3599
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-25 14:55:52 +02:00
parent 6f3dc3198c
commit 6d5c0c0d78

View File

@@ -371,15 +371,14 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
newDeclDoc->check();
// extract the function symbol
if (!newDeclDoc->translationUnit()->ast()) {
if (!newDeclDoc->translationUnit()->ast())
return changes;
}
FunctionDefinitionAST *newDef = newDeclDoc->translationUnit()->ast()->asFunctionDefinition();
if (!newDef) {
if (!newDef)
return changes;
}
Function *newFunction = newDef->symbol;
QTC_ASSERT(newFunction, return changes); // check() should always create this symbol
if (!newFunction)
return changes;
const LookupContext &sourceContext = typeOfExpression.context();
LookupContext targetContext(targetFile->cppDocument(), snapshot);