CppTools: Fix completion for nested enums

Task-number: QTCREATORBUG-5456

Change-Id: I0bb4756e3cdf3c87a4c2b0fbfe6953faaa5e1c52
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Orgad Shaneh
2013-12-15 16:35:43 +02:00
committed by Orgad Shaneh
parent 1ce5b1273a
commit 80a3caa396
3 changed files with 51 additions and 5 deletions

View File

@@ -1342,10 +1342,14 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
ClassOrNamespace *currentBinding = 0;
for (Scope *scope = currentScope; scope; scope = scope->enclosingScope()) {
if (scope->isBlock()) {
if (Block *block = scope->asBlock()) {
if (ClassOrNamespace *binding = context.lookupType(scope)) {
for (unsigned i = 0; i < scope->memberCount(); ++i) {
Symbol *member = scope->memberAt(i);
if (member->isEnum()) {
if (ClassOrNamespace *b = binding->findBlock(block))
completeNamespace(b);
}
if (!member->name())
continue;
if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) {