aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-11-18 18:04:21 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2020-11-23 10:07:20 +0000
commitd3fafcde0fd4f74112d20228ac7175a02ffcb821 (patch)
treed053af9a59ced07acc03384154b3ffc410185a2c /src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
parentb0dd6b748f68af8b53d5c3fc470e5758ddf969de (diff)
CppEditor: Support decl/def switch for conversion operators
Fixes: QTCREATORBUG-21168 Change-Id: I515fe146a679e007c96fa8d23f1457dadf07db3c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp')
-rw-r--r--src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
index 7532b77e8d..5cf1e31d29 100644
--- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
+++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
@@ -579,6 +579,19 @@ void CppEditorPlugin::test_SwitchMethodDeclarationDefinition_data()
"float Test::var;\n"
"int Test::$var;\n"
"}\n");
+
+ QTest::newRow("conversionOperatorDecl2Def")
+ << _("struct Foo {\n"
+ " operator @int() const;\n"
+ "};\n")
+ << _("#include \"file.h\"\n"
+ "Foo::$operator int() const { return {}; }\n");
+ QTest::newRow("conversionOperatorDef2Decl")
+ << _("struct Foo {\n"
+ " $operator int() const;\n"
+ "};\n")
+ << _("#include \"file.h\"\n"
+ "Foo::@operator int() const { return {}; }\n");
}
void CppEditorPlugin::test_SwitchMethodDeclarationDefinition()