Commit 9cc47518 authored by Christian Kamm's avatar Christian Kamm
Browse files

C++ function signature: Abort on unexpected function name.

Change-Id: Iaaa3907f709ea9ed567f59725399efd9024f3bc0
Reviewed-on: http://codereview.qt-project.org/5319

Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent 95590db0
......@@ -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
......
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