Commit daafa533 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

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
parent 5ca2d699
...@@ -229,8 +229,12 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const ...@@ -229,8 +229,12 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const
} }
if (isLocalScope(_declSymbol->enclosingScope()) || isLocalScope(s->enclosingScope())) { if (isLocalScope(_declSymbol->enclosingScope()) || isLocalScope(s->enclosingScope())) {
if (s->enclosingScope() != _declSymbol->enclosingScope()) if (s->enclosingScope()->isTemplate()) {
if (s->enclosingScope()->enclosingScope() != _declSymbol->enclosingScope())
return false; return false;
} else if (s->enclosingScope() != _declSymbol->enclosingScope()) {
return false;
}
} }
if (compareFullyQualifiedName(LookupContext::fullyQualifiedName(s), _declSymbolFullyQualifiedName)) if (compareFullyQualifiedName(LookupContext::fullyQualifiedName(s), _declSymbolFullyQualifiedName))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment