[cfe-commits] [PATCH (need approval) 1/2] Set TemplateKeywordLoc correctly for template specialisations
Douglas Gregor
dgregor at apple.com
Tue Jul 6 11:37:39 PDT 2010
Looks good, thanks! Committed as r107682.
- Doug
On Jul 5, 2010, at 11:42 AM, Peter Collingbourne wrote:
> Currently TemplateKeywordLoc for template specialisations is set to
> KWLoc by ActOnClassTemplateSpecialization. This is wrong because
> KWLoc is in fact the location of the tag keyword. Instead, obtain
> the location of the template keyword via TemplateParams.
> ---
> lib/Sema/SemaTemplate.cpp | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
> index 336a7bf..af1cb50 100644
> --- a/lib/Sema/SemaTemplate.cpp
> +++ b/lib/Sema/SemaTemplate.cpp
> @@ -3959,7 +3959,8 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
> TemplateArgs, CanonType);
> if (TUK != TUK_Friend) {
> Specialization->setTypeAsWritten(WrittenTy);
> - Specialization->setTemplateKeywordLoc(KWLoc);
> + if (TemplateParams)
> + Specialization->setTemplateKeywordLoc(TemplateParams->getTemplateLoc());
> }
> TemplateArgsIn.release();
>
> --
> 1.6.5
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list