Commit 1c7e465c authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

C++: Remove scope argument from initializeSubst

Use the template scope instead.

Change-Id: I8144427e14644697c709643da7c0ae0b0841e34d
Reviewed-by: default avatarNikolai Kosjar <>
parent 997ab425
......@@ -970,8 +970,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
if (decl->isFunction() || decl->isDeclaration()) {
Clone cloner(;
Subst subst(;
initializeSubst(cloner, subst, binding, scope,
specialization, instantiation);
initializeSubst(cloner, subst, binding, specialization, instantiation);
Symbol *instantiatedFunctionTemplate =
cloner.symbol(specialization->declaration(), &subst);
item.setType(instantiatedFunctionTemplate->type()); // override the type
......@@ -1410,7 +1409,7 @@ LookupScopePrivate *LookupScopePrivate::nestedType(const Name *name, LookupScope
Subst subst(;
if (_factory->expandTemplates()) {
Clone cloner(;
_factory->initializeSubst(cloner, subst, origin ? origin->q : 0, 0,
_factory->initializeSubst(cloner, subst, origin ? origin->q : 0,
templateSpecialization, templId);
Instantiator instantiator(cloner, subst);
instantiator.instantiate(reference, instantiation, true);
......@@ -2092,7 +2091,6 @@ bool CreateBindings::visit(ObjCMethod *)
void CreateBindings::initializeSubst(Clone &cloner,
Subst &subst,
LookupScope *origin,
Scope *scope,
Template *specialization,
const TemplateNameId *instantiation)
......@@ -2115,7 +2113,7 @@ void CreateBindings::initializeSubst(Clone &cloner,
cloner.type(tParam->type(), &subst);
TypeResolver typeResolver(*this);
Scope *resolveScope = scope;
Scope *resolveScope = specialization->enclosingScope();
typeResolver.resolve(&ty, &resolveScope, origin);
if (i < templSpecArgumentCount && templSpecId->templateArgumentAt(i)->isPointerType()) {
if (PointerType *pointerType = ty->asPointerType())
......@@ -150,7 +150,7 @@ public:
/// \internal
LookupScope *allocLookupScope(LookupScope *parent, const Name *name);
void initializeSubst(Clone &cloner, Subst &subst, LookupScope *origin, Scope *scope,
void initializeSubst(Clone &cloner, Subst &subst, LookupScope *origin,
Template *specialization, const TemplateNameId *instantiation);
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