diff options
author | John McCall <rjmccall@apple.com> | 2009-11-23 01:53:49 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-11-23 01:53:49 +0000 |
commit | d5532b6cfff2977e0c59fa6ead7f7973984a620d (patch) | |
tree | c4dc0e61ccf65cd514611f1a596d3cb29bf5d658 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 93b189ff4a9bf9fc1901b227657d07ef8383d4e7 (diff) |
Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class. Use it pervasively throughout Sema.
My fingers hurt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 3f40ffcdc1..34dc947422 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1153,11 +1153,12 @@ TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization( = PartialSpec->getTemplateArgsAsWritten(); unsigned N = PartialSpec->getNumTemplateArgsAsWritten(); - llvm::SmallVector<TemplateArgumentLoc, 4> InstTemplateArgs(N); + TemplateArgumentListInfo InstTemplateArgs; // no angle locations for (unsigned I = 0; I != N; ++I) { - if (SemaRef.Subst(PartialSpecTemplateArgs[I], InstTemplateArgs[I], - TemplateArgs)) + TemplateArgumentLoc Loc; + if (SemaRef.Subst(PartialSpecTemplateArgs[I], Loc, TemplateArgs)) return true; + InstTemplateArgs.addArgument(Loc); } @@ -1167,10 +1168,7 @@ TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization( InstTemplateArgs.size()); if (SemaRef.CheckTemplateArgumentList(ClassTemplate, PartialSpec->getLocation(), - /*FIXME:*/PartialSpec->getLocation(), - InstTemplateArgs.data(), - InstTemplateArgs.size(), - /*FIXME:*/PartialSpec->getLocation(), + InstTemplateArgs, false, Converted)) return true; @@ -1203,8 +1201,7 @@ TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization( // template arguments in the specialization. QualType WrittenTy = SemaRef.Context.getTemplateSpecializationType(TemplateName(ClassTemplate), - InstTemplateArgs.data(), - InstTemplateArgs.size(), + InstTemplateArgs, CanonType); if (PrevDecl) { @@ -1238,8 +1235,7 @@ TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization( InstParams, ClassTemplate, Converted, - InstTemplateArgs.data(), - InstTemplateArgs.size(), + InstTemplateArgs, 0); InstPartialSpec->setInstantiatedFromMember(PartialSpec); InstPartialSpec->setTypeAsWritten(WrittenTy); |