forked from qt-creator/qt-creator
C++: Remove scope argument from initializeSubst
Use the template scope instead. Change-Id: I8144427e14644697c709643da7c0ae0b0841e34d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
997ab425ce
commit
1c7e465c30
@@ -970,8 +970,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
|||||||
if (decl->isFunction() || decl->isDeclaration()) {
|
if (decl->isFunction() || decl->isDeclaration()) {
|
||||||
Clone cloner(_control.data());
|
Clone cloner(_control.data());
|
||||||
Subst subst(_control.data());
|
Subst subst(_control.data());
|
||||||
initializeSubst(cloner, subst, binding, scope,
|
initializeSubst(cloner, subst, binding, specialization, instantiation);
|
||||||
specialization, instantiation);
|
|
||||||
Symbol *instantiatedFunctionTemplate =
|
Symbol *instantiatedFunctionTemplate =
|
||||||
cloner.symbol(specialization->declaration(), &subst);
|
cloner.symbol(specialization->declaration(), &subst);
|
||||||
item.setType(instantiatedFunctionTemplate->type()); // override the type
|
item.setType(instantiatedFunctionTemplate->type()); // override the type
|
||||||
@@ -1410,7 +1409,7 @@ LookupScopePrivate *LookupScopePrivate::nestedType(const Name *name, LookupScope
|
|||||||
Subst subst(_control.data());
|
Subst subst(_control.data());
|
||||||
if (_factory->expandTemplates()) {
|
if (_factory->expandTemplates()) {
|
||||||
Clone cloner(_control.data());
|
Clone cloner(_control.data());
|
||||||
_factory->initializeSubst(cloner, subst, origin ? origin->q : 0, 0,
|
_factory->initializeSubst(cloner, subst, origin ? origin->q : 0,
|
||||||
templateSpecialization, templId);
|
templateSpecialization, templId);
|
||||||
Instantiator instantiator(cloner, subst);
|
Instantiator instantiator(cloner, subst);
|
||||||
instantiator.instantiate(reference, instantiation, true);
|
instantiator.instantiate(reference, instantiation, true);
|
||||||
@@ -2092,7 +2091,6 @@ bool CreateBindings::visit(ObjCMethod *)
|
|||||||
void CreateBindings::initializeSubst(Clone &cloner,
|
void CreateBindings::initializeSubst(Clone &cloner,
|
||||||
Subst &subst,
|
Subst &subst,
|
||||||
LookupScope *origin,
|
LookupScope *origin,
|
||||||
Scope *scope,
|
|
||||||
Template *specialization,
|
Template *specialization,
|
||||||
const TemplateNameId *instantiation)
|
const TemplateNameId *instantiation)
|
||||||
{
|
{
|
||||||
@@ -2115,7 +2113,7 @@ void CreateBindings::initializeSubst(Clone &cloner,
|
|||||||
cloner.type(tParam->type(), &subst);
|
cloner.type(tParam->type(), &subst);
|
||||||
|
|
||||||
TypeResolver typeResolver(*this);
|
TypeResolver typeResolver(*this);
|
||||||
Scope *resolveScope = scope;
|
Scope *resolveScope = specialization->enclosingScope();
|
||||||
typeResolver.resolve(&ty, &resolveScope, origin);
|
typeResolver.resolve(&ty, &resolveScope, origin);
|
||||||
if (i < templSpecArgumentCount && templSpecId->templateArgumentAt(i)->isPointerType()) {
|
if (i < templSpecArgumentCount && templSpecId->templateArgumentAt(i)->isPointerType()) {
|
||||||
if (PointerType *pointerType = ty->asPointerType())
|
if (PointerType *pointerType = ty->asPointerType())
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
/// \internal
|
/// \internal
|
||||||
LookupScope *allocLookupScope(LookupScope *parent, const Name *name);
|
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);
|
Template *specialization, const TemplateNameId *instantiation);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user