diff options
author | Reid Kleckner <rnk@google.com> | 2016-10-03 18:34:23 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-10-03 18:34:23 +0000 |
commit | f33bfcb0e0b0764a26294b9cd40bd459081916b3 (patch) | |
tree | b1f4a52539ed21c8569bdc8ce66215dad99a798f /clang/lib/Sema/SemaTemplate.cpp | |
parent | 691e2e020b1b67defd5c2a3f7c5cf0d76056b10a (diff) | |
download | bcm5719-llvm-f33bfcb0e0b0764a26294b9cd40bd459081916b3.tar.gz bcm5719-llvm-f33bfcb0e0b0764a26294b9cd40bd459081916b3.zip |
Factor out a diagnostic kind enum for use in two %select expressions
NFC
llvm-svn: 283131
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 12 |
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; } |