diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-06-10 12:22:27 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-06-10 10:36:10 +0000 |
commit | a9c497e9a431aaaccfd0421aac9879cb1d25623c (patch) | |
tree | a941af0dc2d25e4de0737d19adfe362575379a59 /src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp | |
parent | 43b6b3d1c8ee03d49c9379633f60dc6289188281 (diff) | |
download | qt-creator-a9c497e9a431aaaccfd0421aac9879cb1d25623c.tar.gz |
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.cpp | 6 |
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() |