aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/LookupContext.cpp
diff options
context:
space:
mode:
authorPrzemyslaw Gorszkowski <[email protected]>2013-04-07 17:48:16 +0200
committerErik Verbruggen <[email protected]>2013-04-10 15:04:02 +0200
commiteb30ab6604063550fea2d44a573299b95d459c3c (patch)
tree168013df74b1f7570d82e06954748a6fcddf7463 /src/libs/cplusplus/LookupContext.cpp
parentbde666724083126808507e46bc840eb601631a13 (diff)
C++: fixed code completion for namespace aliases
Task-number: QTCREATORBUG-166 Change-Id: I7a19065a57bfb943e5fc4e2bd9bd81988c1175e3 Reviewed-by: Sergey Shambir <[email protected]> Reviewed-by: Orgad Shaneh <[email protected]> Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/LookupContext.cpp')
-rw-r--r--src/libs/cplusplus/LookupContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 08340671445..d0041d9537c 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -641,7 +641,8 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
if (s->asNamespaceAlias() && binding) {
ClassOrNamespace *targetNamespaceBinding = binding->lookupType(name);
- if (targetNamespaceBinding && targetNamespaceBinding->symbols().size() == 1) {
+ //there can be many namespace definitions
+ if (targetNamespaceBinding && targetNamespaceBinding->symbols().size() > 0) {
Symbol *resolvedSymbol = targetNamespaceBinding->symbols().first();
item.setType(resolvedSymbol->type()); // override the type
}