[PATCH] D61147: [Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 15:29:11 PDT 2019


ahatanak added a comment.

In D61147#1479468 <https://reviews.llvm.org/D61147#1479468>, @erik.pilkington wrote:

> > Yeah, I tend to think we should just suppress this unconditionally in Objective-C.
>
> IMO this warning still makes sense for normal functions, or methods that are only declared in an @implementation. Adding a fix-it to cast to void in the function/method body would probably go a long way too.


Should we use the new warning to warn just about unused ObjC method parameters and have `-Wunused-parameter` warn about everything else? If we make `-Wunused-parameter` unconditionally ignore ObjC methods, a user might complain about it later if `-Wunused-parameter` didn't diagnose an unused parameter when it should have.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61147





More information about the cfe-commits mailing list