CppEditor: Fix "Add Definition" quickfix for function parameters

... whose type is a template.

Fixes: QTCREATORBUG-25560
Change-Id: I1d626f9376e8802a87ca1a28099932ccbf744d47
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-04-08 14:57:57 +02:00
parent 74c1e6ae6d
commit 24eb796231
2 changed files with 3 additions and 2 deletions

View File

@@ -462,6 +462,7 @@ void TypePrettyPrinter::visit(Function *type)
argumentText.showReturnTypes = true;
argumentText.showArgumentNames = false;
argumentText.showFunctionSignatures = true;
argumentText.showTemplateParameters = _overview->showTemplateParameters;
_text += QLatin1Char('(');

View File

@@ -3839,7 +3839,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
QByteArray expected;
// Header File
original = "void f()@;\n";
original = "void f(const std::vector<int> &v)@;\n";
expected = original;
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
@@ -3854,7 +3854,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
"\n"
"int x;\n"
"\n"
"void f()\n"
"void f(const std::vector<int> &v)\n"
"{\n"
"\n"
"}\n"