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
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to