r264522 - [NFC] Tweak diagnostic for template template arguments, to include template aliases.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 26 14:11:17 PDT 2016


On 26 Mar 2016 1:52 p.m., "Faisal Vali via cfe-commits" <
cfe-commits at lists.llvm.org> wrote:
>
> Author: faisalv
> Date: Sat Mar 26 15:46:45 2016
> New Revision: 264522
>
> URL: http://llvm.org/viewvc/llvm-project?rev=264522&view=rev
> Log:
> [NFC]

For future reference, a change to diagnostic wording does count as a
functional change :)

> 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.
>
>
> Modified:
>     cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>     cfe/trunk/lib/Sema/SemaTemplate.cpp
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=264522&r1=264521&r2=264522&view=diff
>
==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Mar 26
15:46:45 2016
> @@ -3570,8 +3570,8 @@ def note_template_unnamed_type_here : No
>    "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<CXXPre1zCompat>, 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<CXXPre1zCompat>, DefaultIgnore;
> +  def ext_star_this_lambda_capture_cxx1z : ExtWarn<
>      "capture of '*this' by copy is a C++1z extension">, InGroup<CXX1z>;
>  }
>
>
> Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=264522&r1=264521&r2=264522&view=diff
>
==============================================================================
> --- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaTemplate.cpp Sat Mar 26 15:46:45 2016
> @@ -800,7 +800,7 @@ Decl *Sema::ActOnTemplateTemplateParamet
>      // 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(Templat
>        !isa<TypeAliasTemplateDecl>(Template)) {
>      assert(isa<FunctionTemplateDecl>(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;
>    }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160326/912bc8c1/attachment.html>


More information about the cfe-commits mailing list