[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

Idriss via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 15 07:50:44 PDT 2018


IdrissRio added a comment.

In https://reviews.llvm.org/D52135#1235950, @lebedev.ri wrote:

>




> It will now completely skip all the explicitly instantiated functions, no?

In my opinion, for this kind of check,  we don't have the necessity to take in consideration the function instantiation. We only have to consider the function definition/declaration.

> I'd think the problem that needs to be fixed is that it considers the local variable `int a_template;` to be in the function argument list.

No the problem is that the ast_matcher find 2 occurrence of g_template: the first is the definition of g_template() and the second is the instantiation of g_template. The second is the one that create the problem since  it start to iterate all over the body of the function trying to fine  the the tokens '( void )' that in this case is this guiltless void cast : (void)a_template.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52135





More information about the cfe-commits mailing list