aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-06-10 12:22:27 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-06-10 10:36:10 +0000
commita9c497e9a431aaaccfd0421aac9879cb1d25623c (patch)
treea941af0dc2d25e4de0737d19adfe362575379a59 /src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
parent43b6b3d1c8ee03d49c9379633f60dc6289188281 (diff)
CPlusPlus: Fix overload resolution involving default arguments
If one of the overloads had additional default arguments, then for each of these, its priority was increased, which does not appear to make any sense. Fixes: QTCREATORBUG-17807 Change-Id: Id5be81ce52c615a424fe4314d2e50385b3fb2b1c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp')
-rw-r--r--src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
index 5a82792ad8..3a04c69a00 100644
--- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
+++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
@@ -979,6 +979,12 @@ void CppEditorPlugin::test_FollowSymbolUnderCursor_data()
"template<class $T>\n"
"using Foo = Bar<@T>;\n"
);
+
+ QTest::newRow("shadowed overload with default args") << _(
+ "struct Parent { void disconnect(int n = 0); };\n"
+ "struct Child : public Parent { void $disconnect(); };\n"
+ "void test() { Child c; c.@disconnect(); }\n"
+ );
}
void CppEditorPlugin::test_FollowSymbolUnderCursor()