diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-02-23 23:53:22 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-03-04 14:37:56 +0100 |
commit | 151899b1b8a046d9c3c31d229519a2f430f1e514 (patch) | |
tree | ca58fa22776c335749dd024624cc5ab68f6b20a4 /src/plugins/cpptools | |
parent | 29091078ad5d0ad3c7688fef227ab72dcef1fac1 (diff) |
CppTools: Avoid matching function by name only
Compare full function signature, or at least argument count.
Task-number: QTCREATORBUG-10295
Change-Id: Iead4d067209a8aea77cfcea2cd1ca5d08f87b165
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/symbolfinder.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/cpptools/symbolfinder.cpp b/src/plugins/cpptools/symbolfinder.cpp index 74b5f2d0a79..3f6f192bc25 100644 --- a/src/plugins/cpptools/symbolfinder.cpp +++ b/src/plugins/cpptools/symbolfinder.cpp @@ -73,8 +73,8 @@ public: if (_oper->isEqualTo(name)) _result.append(fun); } - } else if (const Identifier *id = _declaration->identifier()) { - if (id->isEqualTo(fun->identifier())) + } else if (Function *decl = _declaration->type()->asFunctionType()) { + if (fun->isEqualTo(decl)) _result.append(fun); } @@ -338,7 +338,6 @@ QList<Declaration *> SymbolFinder::findMatchingDeclaration(const LookupContext & findMatchingDeclaration(context, functionType, &typeMatch, &argumentCountMatch, &nameMatch); result.append(typeMatch); result.append(argumentCountMatch); - result.append(nameMatch); return result; } |