<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117931>117931</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
regression: clang -Wunused-parameter stopped warning for unused params in Objective-C methods at some point
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
seanm
</td>
</tr>
</table>
<pre>
I don't know when it happened, and [godbolt compiler explorer does not support Obj-C with clang](https://github.com/compiler-explorer/compiler-explorer/issues/7064), but clang's `-Wunused-parameter` used to warn for unused Obj-C method parameters, but now it doesn't.
Example code:
```objc
@interface RRPoint
- (instancetype)initWithX:(double)inX Y:(double)inY Z:(double)inZ;
@end
@implementation RRPoint
- (instancetype)initWithX:(double)inX Y:(double)inY Z:(double)inZ
{
return self;
}
@end
int main (int argc, const char * argv[])
{
return 0;
}
```
Result with old AppleClang 10 (Xcode 10.1):
```
builder22:Desktop builder$ xcrun clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
```
```
builder22:Desktop builder$ xcrun clang -fsyntax-only -Wunused-parameter test.m
test.m:9:35: warning: unused parameter 'inX' [-Wunused-parameter]
- (instancetype)initWithX:(double)inX Y:(double)inY Z:(double)inZ
^
```
Yet with newer AppleClang and open source clang 19.1.3, there is no warning.
(Godbolt compiler explorer does support Obj-C with gcc, and gcc does still warn here, FWIW)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vd9r5DYQ_mu0L4ONLP-KH_zgJJdycKUllCa5lyJLs7buZMlIcjb574tsby5lr1cotCGw2tnRzDcz33zi3qvBILakvCbl7YEvYbSu9cjNdOitfG0_grSGsDrAV2NPcBrRgAow8nlGg5KwG-BGAimvByt7qwMIO81KowN8mbV16EBa9GBsAL_Ms3UBfum_JDdwUmEEobkZSHlL2NUYwuxJ3hF2R9jdoMK49KmwE2F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