Commit 02c73367 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Expand the template parameters.

parent fef2ad6b
......@@ -447,6 +447,9 @@ void LookupContext::expandClass(Class *klass,
const QList<Scope *> &visibleScopes,
QList<Scope *> *expandedScopes) const
{
for (TemplateParameters *params = klass->templateParameters(); params; params = params->previous())
expand(params->scope(), visibleScopes, expandedScopes);
for (unsigned i = 0; i < klass->memberCount(); ++i) {
Symbol *symbol = klass->memberAt(i);
if (Class *nestedClass = symbol->asClass()) {
......@@ -510,6 +513,9 @@ void LookupContext::expandFunction(Function *function,
const QList<Scope *> &visibleScopes,
QList<Scope *> *expandedScopes) const
{
for (TemplateParameters *params = function->templateParameters(); params; params = params->previous())
expand(params->scope(), visibleScopes, expandedScopes);
if (! expandedScopes->contains(function->arguments()))
expandedScopes->append(function->arguments());
......
......@@ -637,11 +637,15 @@ ResolveExpression::resolveBaseExpression(const QList<LookupItem> &baseResults, i
if (NamedType *namedTy = ty->asNamedType()) {
const QList<Scope *> visibleScopes = _context.visibleScopes(result);
const QList<Symbol *> typedefCandidates = _context.resolve(namedTy->name(), visibleScopes);
foreach (Symbol *typedefCandidate, typedefCandidates) {
if (typedefCandidate->isTypedef() && typedefCandidate->type()->isNamedType()) {
ty = typedefCandidate->type();
lastVisibleSymbol = typedefCandidate;
const QList<Symbol *> candidates = _context.resolve(namedTy->name(), visibleScopes);
foreach (Symbol *candidate, candidates) {
if (candidate->isTypedef() && candidate->type()->isNamedType()) {
ty = candidate->type();
lastVisibleSymbol = candidate;
break;
} else if (TypenameArgument *arg = candidate->asTypenameArgument()) {
ty = arg->type();
lastVisibleSymbol = candidate;
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment