summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index b1bb97b7586..7061f079ac7 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -2468,7 +2468,7 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK,
// If the identifier resolves to a typedef-name or the simple-template-id
// resolves to an alias template specialization, the
// elaborated-type-specifier is ill-formed.
- Diag(TemplateLoc, diag::err_tag_reference_non_tag) << 4;
+ Diag(TemplateLoc, diag::err_tag_reference_non_tag) << NTK_TypeAliasTemplate;
Diag(TAT->getLocation(), diag::note_declared_at);
}
@@ -7438,14 +7438,8 @@ Sema::ActOnExplicitInstantiation(Scope *S,
ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(TD);
if (!ClassTemplate) {
- unsigned ErrorKind = 0;
- if (isa<TypeAliasTemplateDecl>(TD)) {
- ErrorKind = 4;
- } else if (isa<TemplateTemplateParmDecl>(TD)) {
- ErrorKind = 5;
- }
-
- Diag(TemplateNameLoc, diag::err_tag_reference_non_tag) << ErrorKind;
+ NonTagKind NTK = getNonTagTypeDeclKind(TD);
+ Diag(TemplateNameLoc, diag::err_tag_reference_non_tag) << NTK;
Diag(TD->getLocation(), diag::note_previous_use);
return true;
}
OpenPOWER on IntegriCloud