diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 20e5cb4418df9d77f23ce45653ed024bddce6992..38f168cebd196675b03f88513b37e977c27e6b5c 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))