CppEditor: Make "Move Definition" available for member templates

The resulting signature is broken; this needs to be fixed in a follow-up
patch.

Task-number: QTCREATORBUG-28186
Change-Id: I9b8211c6d6a4b7bef5940da5e74dda00024abd19
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2022-11-29 15:25:18 +01:00
parent 4e7adc2462
commit 524f9e063a

View File

@@ -6430,6 +6430,10 @@ void MoveFuncDefOutside::match(const CppQuickFixInterface &interface, QuickFixOp
if (path.at(idx - 2)->asNamespace()) // normal function in namespace if (path.at(idx - 2)->asNamespace()) // normal function in namespace
break; break;
} }
if (idx > 2 && path.at(idx - 1)->asTemplateDeclaration()) {
if ((classAST = path.at(idx - 3)->asSimpleDeclaration())) // member template
break;
}
} }
funcAST = nullptr; funcAST = nullptr;
} }