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 | 1806c2795bdccce6ad20d448b90836ed43e70124 (patch) | |
tree | 5efb41e55edce14d0dea22b3bd7ddc8b8f1fb5a6 /clang/lib/Sema/SemaTemplate.cpp | |
parent | 19a9f42f20b10865385877bdb42619020dc95270 (diff) | |
download | bcm5719-llvm-1806c2795bdccce6ad20d448b90836ed43e70124.tar.gz bcm5719-llvm-1806c2795bdccce6ad20d448b90836ed43e70124.zip |
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.
llvm-svn: 81515
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 63c29de82b4..8bb33eb9854 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/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 |