From e8fc85034216ea21221c8c172144d3685079e73d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 30 Sep 2009 12:05:12 +0200 Subject: [PATCH] Don't search for the canonical symbol in the base classes (at least for now). --- src/libs/cplusplus/LookupContext.cpp | 29 ++++++---------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index a736b3dd7af..9c13caea159 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -504,10 +504,12 @@ void LookupContext::expand(Scope *scope, Symbol *LookupContext::canonicalSymbol(Symbol *symbol) { Symbol *canonical = symbol; + for (; symbol; symbol = symbol->next()) { if (symbol->name() == canonical->name()) canonical = symbol; } + return canonical; } @@ -516,35 +518,16 @@ Symbol *LookupContext::canonicalSymbol(const QList &candidates) if (candidates.isEmpty()) return 0; - Symbol *candidate = candidates.first(); - if (candidate->scope()->isClassScope() && candidate->type()->isFunctionType()) { - Function *function = 0; - - for (int i = 0; i < candidates.size(); ++i) { - Symbol *c = candidates.at(i); - - if (! c->scope()->isClassScope()) - continue; - - else if (Function *f = c->type()->asFunctionType()) { - if (f->isVirtual()) - function = f; - } - } - - if (function) - return canonicalSymbol(function); - } - - return canonicalSymbol(candidate); + return canonicalSymbol(candidates.first()); } Symbol *LookupContext::canonicalSymbol(const QList > &results) { QList candidates; QPair result; - foreach (result, results) { + + foreach (result, results) candidates.append(result.second); // ### not exacly. - } + return canonicalSymbol(candidates); }