[PATCH] D109359: [TableGen] Optionally emit a warning for unused template args

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 07:24:16 PDT 2021


c-rhodes added a comment.

In D109359#2986753 <https://reviews.llvm.org/D109359#2986753>, @c-rhodes wrote:

> In D109359#2986672 <https://reviews.llvm.org/D109359#2986672>, @Paul-C-Anagnostopoulos wrote:
>
>> This is a great feature. Do we also need to add an 'unused' declaration that acknowledges the non-use of a template argument and suppresses the warning?
>
> I'm not really sure what an unused declaration would look like in TableGen, in C I think prefixing unused args with `(void)` is the usual way of suppressing these kind of errors. One existing way to suppress the warning could be:
>
>   class Foo<int x> {
>     int x = x;
>   }
>
> but that's not particularly pretty.

scratch that, that example results in a recursion / self-assignment forbidden error.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109359/new/

https://reviews.llvm.org/D109359



More information about the llvm-commits mailing list