[PATCH] PR10405 Missing actual type (aka) in error message when using decltype as a template parameter

Richard Smith richard at metafoo.co.uk
Fri May 30 15:12:01 PDT 2014


On Thu, May 29, 2014 at 8:25 PM, Nikola Smiljanić <popizdeh at gmail.com>
wrote:

> ================
> Comment at: lib/AST/ASTDiagnostic.cpp:72
> @@ +71,3 @@
> +        = dyn_cast<TemplateSpecializationType>(Ty)) {
> +      for (auto Arg : *TST) {
> +          if (Arg.getKind() == TemplateArgument::Type)
> ----------------
> Richard Smith wrote:
> > Please don't use a `TemplateSpecializationType` as a container like
> this; it's not notionally a container of template arguments. Instead, add
> an `arguments` member function to `TemplateSpecializationType` to return
> the arguments list.
> The class already has `getArgs`, `getNumArgs` and `getArg` methods. But
> why does it have `begin` and `end` if not to be used as a container?


Those names predate the use of range-based for loops in Clang, and should
probably be renamed to args_begin() and args_end().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140530/58fbcf97/attachment.html>


More information about the cfe-commits mailing list