diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2011-01-17 13:39:41 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2011-01-17 13:42:45 +0100 |
commit | daafa533d6e9d2efbbfdbf97d44ee8edabbaa957 (patch) | |
tree | 781114d54d5194ce4d8795d70b48defa57a177de /src | |
parent | 5ca2d6990a799befb38e86a8d665597a4b569c8f (diff) | |
download | qt-creator-daafa533d6e9d2efbbfdbf97d44ee8edabbaa957.tar.gz |
Fix find-usages in template classes.
The problem was that the scope of the class declaration in a template-class
declaration is the template, not the scope in which that template is defined.
The scope-check was not taking this into account.
Task-number: QTCREATORBUG-3183
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/cplusplus/FindUsages.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 20e5cb4418..38f168cebd 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -229,8 +229,12 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const } if (isLocalScope(_declSymbol->enclosingScope()) || isLocalScope(s->enclosingScope())) { - if (s->enclosingScope() != _declSymbol->enclosingScope()) + if (s->enclosingScope()->isTemplate()) { + if (s->enclosingScope()->enclosingScope() != _declSymbol->enclosingScope()) + return false; + } else if (s->enclosingScope() != _declSymbol->enclosingScope()) { return false; + } } if (compareFullyQualifiedName(LookupContext::fullyQualifiedName(s), _declSymbolFullyQualifiedName)) |