Semantic analysis for explicit instantiation of class templates. We
still aren't instantiating the definitions of class template members,
and core issues 275 and 259 will both affect the checking that we do
for explicit instantiations (but are not yet implemented).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71613 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 0fe6cee..ce8cbe0 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -666,7 +666,8 @@
bool
Sema::InstantiateClass(SourceLocation PointOfInstantiation,
CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern,
- const TemplateArgumentList &TemplateArgs) {
+ const TemplateArgumentList &TemplateArgs,
+ bool ExplicitInstantiation) {
bool Invalid = false;
CXXRecordDecl *PatternDef
@@ -678,8 +679,8 @@
<< Context.getTypeDeclType(Instantiation);
Diag(Pattern->getLocation(), diag::note_member_of_template_here);
} else {
- Diag(PointOfInstantiation,
- diag::err_template_implicit_instantiate_undefined)
+ Diag(PointOfInstantiation, diag::err_template_instantiate_undefined)
+ << ExplicitInstantiation
<< Context.getTypeDeclType(Instantiation);
Diag(Pattern->getLocation(), diag::note_template_decl_here);
}
@@ -766,7 +767,8 @@
return InstantiateClass(ClassTemplateSpec->getLocation(),
ClassTemplateSpec, Pattern,
- ClassTemplateSpec->getTemplateArgs());
+ ClassTemplateSpec->getTemplateArgs(),
+ ExplicitInstantiation);
}
/// \brief Instantiate a nested-name-specifier.