diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTContext.cpp | 8 | ||||
-rw-r--r-- | lib/AST/Type.cpp | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e2074e8b74..065ebe9f9a 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -40,6 +40,8 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, bool FreeMem, unsigned size_reserve) : + TemplateSpecializationTypes(this_()), + DependentTemplateSpecializationTypes(this_()), GlobalNestedNameSpecifier(0), CFConstantStringTypeDecl(0), NSConstantStringTypeDecl(0), ObjCFastEnumerationStateTypeDecl(0), FILEDecl(0), jmp_bufDecl(0), @@ -1824,7 +1826,7 @@ ASTContext::getTemplateSpecializationType(TemplateName Template, void *Mem = Allocate((sizeof(TemplateSpecializationType) + sizeof(TemplateArgument) * NumArgs), TypeAlignment); - Spec = new (Mem) TemplateSpecializationType(*this, CanonTemplate, false, + Spec = new (Mem) TemplateSpecializationType(CanonTemplate, false, CanonArgs.data(), NumArgs, Canon); Types.push_back(Spec); @@ -1844,7 +1846,7 @@ ASTContext::getTemplateSpecializationType(TemplateName Template, sizeof(TemplateArgument) * NumArgs), TypeAlignment); TemplateSpecializationType *Spec - = new (Mem) TemplateSpecializationType(*this, Template, + = new (Mem) TemplateSpecializationType(Template, IsCurrentInstantiation, Args, NumArgs, Canon); @@ -1970,7 +1972,7 @@ ASTContext::getDependentTemplateSpecializationType( void *Mem = Allocate((sizeof(DependentTemplateSpecializationType) + sizeof(TemplateArgument) * NumArgs), TypeAlignment); - T = new (Mem) DependentTemplateSpecializationType(*this, Keyword, NNS, + T = new (Mem) DependentTemplateSpecializationType(Keyword, NNS, Name, NumArgs, Args, Canon); Types.push_back(T); DependentTemplateSpecializationTypes.InsertNode(T, InsertPos); diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index c8cdae3af8..7a699b0015 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -871,12 +871,12 @@ void DependentTemplateSpecializationType::Destroy(ASTContext &C) { } DependentTemplateSpecializationType::DependentTemplateSpecializationType( - ASTContext &Context, ElaboratedTypeKeyword Keyword, + ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, unsigned NumArgs, const TemplateArgument *Args, QualType Canon) : TypeWithKeyword(Keyword, DependentTemplateSpecialization, Canon, true), - Context(Context), NNS(NNS), Name(Name), NumArgs(NumArgs) { + NNS(NNS), Name(Name), NumArgs(NumArgs) { assert(NNS && NNS->isDependent() && "DependentTemplateSpecializatonType requires dependent qualifier"); for (unsigned I = 0; I != NumArgs; ++I) @@ -1130,14 +1130,14 @@ anyDependentTemplateArguments(const TemplateArgument *Args, unsigned N) { } TemplateSpecializationType:: -TemplateSpecializationType(ASTContext &Context, TemplateName T, +TemplateSpecializationType(TemplateName T, bool IsCurrentInstantiation, const TemplateArgument *Args, unsigned NumArgs, QualType Canon) : Type(TemplateSpecialization, Canon.isNull()? QualType(this, 0) : Canon, T.isDependent() || anyDependentTemplateArguments(Args, NumArgs)), - ContextAndCurrentInstantiation(&Context, IsCurrentInstantiation), + IsCurrentInstantiation(IsCurrentInstantiation), Template(T), NumArgs(NumArgs) { assert((!Canon.isNull() || T.isDependent() || anyDependentTemplateArguments(Args, NumArgs)) && |