diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-10-31 11:37:51 +0100 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-10-31 11:52:07 +0100 |
commit | 5cd2123862da2217237eb8644523672c398e8d9a (patch) | |
tree | 653ded9433d261bb0b825e58b78ebb1b56cd27a7 /src/libs/cplusplus/CppDocument.cpp | |
parent | 4521be25cd6888f9412c0a6350171dd0383ede0a (diff) | |
download | qt-creator-5cd2123862da2217237eb8644523672c398e8d9a.tar.gz |
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>
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 0df7704e09..f8ff42ca9c 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -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())) |