C++: Enable showEnclosingTemplate also for function type

Do not require directly passing the enclosing template.

Change-Id: Ie03bc58338fe003677a5f5311d86d70f499373ee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Orgad Shaneh
2016-08-21 22:21:03 +03:00
committed by Orgad Shaneh
parent 50a6c47830
commit 39aff55d8a
3 changed files with 25 additions and 24 deletions

View File

@@ -2510,13 +2510,8 @@ QString InsertDeclOperation::generateDeclaration(const Function *function)
oo.showArgumentNames = true;
oo.showEnclosingTemplate = true;
const Symbol *symbol = function;
if (const Scope *enclosingScope = function->enclosingScope()) {
if (const Template *templ = enclosingScope->asTemplate())
symbol = templ;
}
QString decl;
decl += oo.prettyType(symbol->type(), function->unqualifiedName());
decl += oo.prettyType(function->type(), function->unqualifiedName());
decl += QLatin1String(";\n");
return decl;