forked from qt-creator/qt-creator
C++ function signature: Abort on unexpected function name.
Change-Id: Iaaa3907f709ea9ed567f59725399efd9024f3bc0 Reviewed-on: http://codereview.qt-project.org/5319 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -510,15 +510,22 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
||||
if (!newFunction)
|
||||
return changes;
|
||||
|
||||
LookupContext sourceContext(sourceDocument, snapshot);
|
||||
LookupContext targetContext(targetFile->cppDocument(), snapshot);
|
||||
|
||||
Overview overview;
|
||||
overview.setShowReturnTypes(true);
|
||||
overview.setShowTemplateParameters(true);
|
||||
overview.setShowArgumentNames(true);
|
||||
overview.setShowFunctionSignatures(true);
|
||||
|
||||
// abort if the name of the newly parsed function is not the expected one
|
||||
DeclaratorIdAST *newDeclId = getDeclaratorId(newDef->declarator);
|
||||
if (!newDeclId || !newDeclId->name || !newDeclId->name->name
|
||||
|| overview(newDeclId->name->name) != nameInitial) {
|
||||
return changes;
|
||||
}
|
||||
|
||||
LookupContext sourceContext(sourceDocument, snapshot);
|
||||
LookupContext targetContext(targetFile->cppDocument(), snapshot);
|
||||
|
||||
// sync return type
|
||||
{
|
||||
// set up for rewriting return type
|
||||
|
||||
Reference in New Issue
Block a user