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
This commit is contained in:
Erik Verbruggen
2011-01-17 13:39:41 +01:00
parent 5ca2d6990a
commit daafa533d6

View File

@@ -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))