forked from qt-creator/qt-creator
C++: Fix completion for namespace aliases at global or namespace scope.
Task-number: QTCREATORBUG-166 Change-Id: Ic0fe4067caad37e51f7e253fd6678a6680350870 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -518,6 +518,14 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
|||||||
item.setDeclaration(s);
|
item.setDeclaration(s);
|
||||||
item.setBinding(binding);
|
item.setBinding(binding);
|
||||||
|
|
||||||
|
if (s->asNamespaceAlias() && binding) {
|
||||||
|
ClassOrNamespace *targetNamespaceBinding = binding->lookupType(name);
|
||||||
|
if (targetNamespaceBinding && targetNamespaceBinding->symbols().size() == 1) {
|
||||||
|
Symbol *resolvedSymbol = targetNamespaceBinding->symbols().first();
|
||||||
|
item.setType(resolvedSymbol->type()); // override the type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (templateId && (s->isDeclaration() || s->isFunction())) {
|
if (templateId && (s->isDeclaration() || s->isFunction())) {
|
||||||
FullySpecifiedType ty = DeprecatedGenTemplateInstance::instantiate(templateId, s, _control);
|
FullySpecifiedType ty = DeprecatedGenTemplateInstance::instantiate(templateId, s, _control);
|
||||||
item.setType(ty); // override the type.
|
item.setType(ty); // override the type.
|
||||||
|
Reference in New Issue
Block a user