diff options
author | John McCall <rjmccall@apple.com> | 2009-09-11 07:25:08 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-09-11 07:25:08 +0000 |
commit | 9cc7807e1622c2f945b607bdd39dd283df5e7bb5 (patch) | |
tree | 6f0f78fbe2e91afc5c80350049553e2b4f17b2e0 /lib/Sema/SemaTemplate.cpp | |
parent | 136a6988960ac3aeb96f298da7a1a182db7217cd (diff) |
Track a class template specialization's point of instantiation separately
from its location. Initialize appropriately.
When implicitly creating a declaration of a class template specialization
after encountering the first reference to it, use the pattern class's
location instead of the location of the first reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 63c29de82b..8bb33eb985 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -1097,7 +1097,7 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, // the set of specializations. Decl = ClassTemplateSpecializationDecl::Create(Context, ClassTemplate->getDeclContext(), - TemplateLoc, + ClassTemplate->getLocation(), ClassTemplate, Converted, 0); ClassTemplate->getSpecializations().InsertNode(Decl, InsertPos); @@ -3027,6 +3027,8 @@ Sema::ActOnExplicitInstantiation(Scope *S, Specialization->setLexicalDeclContext(CurContext); CurContext->addDecl(Specialization); + Specialization->setPointOfInstantiation(TemplateNameLoc); + // C++ [temp.explicit]p3: // A definition of a class template or class member template // shall be in scope at the point of the explicit instantiation of |