C++: Fix findMatchingDeclaration for functions not in a class.

That fixes navigation and the 'function signature update' quickfix for
global functions and functions in namespaces.

Task-number: QTCREATORBUG-6413
Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-31 11:37:51 +01:00
parent 4521be25cd
commit 5cd2123862

View File

@@ -918,11 +918,11 @@ void CPlusPlus::findMatchingDeclaration(const LookupContext &context,
return;
foreach (Symbol *s, binding->symbols()) {
Class *matchingClass = s->asClass();
if (!matchingClass)
Scope *scope = s->asScope();
if (!scope)
continue;
for (Symbol *s = matchingClass->find(funcId); s; s = s->next()) {
for (Symbol *s = scope->find(funcId); s; s = s->next()) {
if (! s->name())
continue;
else if (! funcId->isEqualTo(s->identifier()))