From 524f9e063a5df743817a4573f939d42212fb71a8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 29 Nov 2022 15:25:18 +0100 Subject: 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: Reviewed-by: Qt CI Bot Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppquickfixes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 46a31e1a87..c57c6360da 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -6430,6 +6430,10 @@ void MoveFuncDefOutside::match(const CppQuickFixInterface &interface, QuickFixOp if (path.at(idx - 2)->asNamespace()) // normal function in namespace break; } + if (idx > 2 && path.at(idx - 1)->asTemplateDeclaration()) { + if ((classAST = path.at(idx - 3)->asSimpleDeclaration())) // member template + break; + } } funcAST = nullptr; } -- cgit v1.2.3