forked from qt-creator/qt-creator
CppEditor: Fix moving function definition out of specialized class
Fixes: QTCREATORBUG-25808 Change-Id: I5950c7f66b736c6ee30411e8fdc0356d78faa518 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -6521,6 +6521,33 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_template()
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_template_specializedClass()
|
||||
{
|
||||
QByteArray original = R"(
|
||||
template<typename T> class base {};
|
||||
template<>
|
||||
class base<int>
|
||||
{
|
||||
public:
|
||||
void @bar() {}
|
||||
};
|
||||
)";
|
||||
QByteArray expected = R"(
|
||||
template<typename T> class base {};
|
||||
template<>
|
||||
class base<int>
|
||||
{
|
||||
public:
|
||||
void bar();
|
||||
};
|
||||
|
||||
void base<int>::bar() {}
|
||||
)";
|
||||
|
||||
MoveFuncDefOutside factory;
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_unnamedTemplate()
|
||||
{
|
||||
QByteArray original =
|
||||
|
||||
Reference in New Issue
Block a user