aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-11-29 15:25:18 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2022-12-01 12:17:32 +0000
commit524f9e063a5df743817a4573f939d42212fb71a8 (patch)
treec1097ece8447a484e482866ebf197e9c8767d7bb
parent4e7adc24628a75312541516d18a11ed9cda924d3 (diff)
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>
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp4
1 files changed, 4 insertions, 0 deletions
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;
}