From 77ad193cab580e52337dd12b9c1ff23fead71b88 Mon Sep 17 00:00:00 2001 From: Faisal Vali Date: Sat, 26 Mar 2016 20:46:45 +0000 Subject: [PATCH] [NFC] Tweak diagnostic for template template arguments, to include template aliases. The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias. The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264522 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 12 ++++++------ lib/Sema/SemaTemplate.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index c763611d73..e9c5c78475 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3570,8 +3570,8 @@ def note_template_unnamed_type_here : Note< "unnamed type used in template argument was declared here">; def err_template_arg_overload_type : Error< "template argument is the type of an unresolved overloaded function">; -def err_template_arg_not_class_template : Error< - "template argument does not refer to a class template or template " +def err_template_arg_not_valid_template : Error< + "template argument does not refer to a class or alias template, or template " "template parameter">; def note_template_arg_refers_here_func : Note< "template argument refers to function template %0, here">; @@ -5993,10 +5993,10 @@ let CategoryName = "Lambda Issue" in { "cannot deduce type for lambda capture %0 from initializer list">; // C++1z '*this' captures. - def warn_cxx14_compat_star_this_lambda_capture : Warning< - "by value capture of '*this' is incompatible with C++ standards before C++1z">, - InGroup, DefaultIgnore; - def ext_star_this_lambda_capture_cxx1z : ExtWarn< + def warn_cxx14_compat_star_this_lambda_capture : Warning< + "by value capture of '*this' is incompatible with C++ standards before C++1z">, + InGroup, DefaultIgnore; + def ext_star_this_lambda_capture_cxx1z : ExtWarn< "capture of '*this' by copy is a C++1z extension">, InGroup; } diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 0b4b083ffb..18b739df7f 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -800,7 +800,7 @@ Decl *Sema::ActOnTemplateTemplateParameter(Scope* S, // However, it isn't worth doing. TemplateArgumentLoc DefaultArg = translateTemplateArgument(*this, Default); if (DefaultArg.getArgument().getAsTemplate().isNull()) { - Diag(DefaultArg.getLocation(), diag::err_template_arg_not_class_template) + Diag(DefaultArg.getLocation(), diag::err_template_arg_not_valid_template) << DefaultArg.getSourceRange(); return Param; } @@ -5352,7 +5352,7 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param, !isa(Template)) { assert(isa(Template) && "Only function templates are possible here"); - Diag(Arg.getLocation(), diag::err_template_arg_not_class_template); + Diag(Arg.getLocation(), diag::err_template_arg_not_valid_template); Diag(Template->getLocation(), diag::note_template_arg_refers_here_func) << Template; } -- 2.40.0