diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-16 01:09:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-16 01:09:10 +0000 |
commit | 7e54fb5fcc7d7b8e843501652cf7c19cea6c4c57 (patch) | |
tree | e8a4ab38aa16a2b4502da66f01884a7a70585ae4 /lib/Sema/SemaTemplate.cpp | |
parent | d8672ef2d343a0dbfe838724fb2d9fb4efea6041 (diff) |
PR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
as an array of its base class TemplateArgument. Switch the const
TemplateArgument* parameters of InstantiatingTemplate's constructors to
ArrayRef<TemplateArgument> to prevent this from happening again in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index f76c75ad7f..1c3feb51eb 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2554,8 +2554,7 @@ SubstDefaultTemplateArgument(Sema &SemaRef, = SemaRef.getTemplateInstantiationArgs(Template, &TemplateArgs); Sema::InstantiatingTemplate Inst(SemaRef, TemplateLoc, - Template, Converted.data(), - Converted.size(), + Template, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Inst) return 0; @@ -2605,8 +2604,7 @@ SubstDefaultTemplateArgument(Sema &SemaRef, = SemaRef.getTemplateInstantiationArgs(Template, &TemplateArgs); Sema::InstantiatingTemplate Inst(SemaRef, TemplateLoc, - Template, Converted.data(), - Converted.size(), + Template, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Inst) return ExprError(); @@ -2656,8 +2654,7 @@ SubstDefaultTemplateArgument(Sema &SemaRef, = SemaRef.getTemplateInstantiationArgs(Template, &TemplateArgs); Sema::InstantiatingTemplate Inst(SemaRef, TemplateLoc, - Template, Converted.data(), - Converted.size(), + Template, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Inst) return TemplateName(); @@ -2792,7 +2789,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, !Template->getDeclContext()->isDependentContext()) { // Do substitution on the type of the non-type template parameter. InstantiatingTemplate Inst(*this, TemplateLoc, Template, - NTTP, Converted.data(), Converted.size(), + NTTP, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Inst) return true; @@ -2926,7 +2923,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, // Set up a template instantiation context. LocalInstantiationScope Scope(*this); InstantiatingTemplate Inst(*this, TemplateLoc, Template, - TempParm, Converted.data(), Converted.size(), + TempParm, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Inst) return true; @@ -3158,8 +3155,8 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template, // Introduce an instantiation record that describes where we are using // the default template argument. - InstantiatingTemplate Instantiating(*this, RAngleLoc, Template, *Param, - Converted.data(), Converted.size(), + InstantiatingTemplate Instantiating(*this, RAngleLoc, Template, + *Param, Converted, SourceRange(TemplateLoc, RAngleLoc)); if (Instantiating) return true; |