<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154755>154755</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-tidy invalid suggestion: performance-unnecessary-value-param
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
joker-eph
</td>
</tr>
</table>
<pre>
With clang-tidy built at current head and applying it on MLIR:
```
$ bin/clang-tidy -p build mlir/lib/Bindings/Python/IRCore.cpp --checks=-*,performance-unnecessary-value-param -fix -fix-errors
```
One of the hunk is:
```
@@ -196,7 +197,7 @@ operations.
/// Helper for creating an @classmethod.
template <class Func, typename... Args>
-static nb::object classmethod(Func f, Args... args) {
+static nb::object classmethod(Func f, const Args... &args) {
nb::object cf = nb::cpp_function(f, args...);
return nb::borrow<nb::object>((PyClassMethod_New(cf.ptr())));
}
```
But clang does not agree:
```
mlir/lib/Bindings/Python/IRCore.cpp:200:49: error: '...' must immediately precede declared identifier
200 | static nb::object classmethod(Func f, const Args... &args) {
| ^~~
| ...
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslM-v2zYMx_8a5kI4kCX7xT744OQ1WIF1K3rZsZAlxlYrS4Ykp8ulf_tg5e39WHdYgQFMLIjmxyT1FWWMZnREHdRHqB93ck2TD90X_5VCQcu0G7y-dX-YNKGy0o1FMvqGw2psQplQrSGQSziR1CidRrks9mbciCahd_jh1_efQPTAsj2wJ2M98AoH44CfX2GLJZM1ztYE4GdrBuDno3HauDECP3-8pclvQe8_nXygvVoWLAo1kfoaQTwWwHvgp4XCxYdZOkXF6hwpilGGW3GVdqVikUHOWFzMn_mvoBB8iP9Mj_W_O0J_wTQRTqv7iiY-FfL6tYpBxbAo2wfgpwMCP5bt4b68u_xCQSbjXdwD6zH_-Plu-AvZhQJefEAVSKatb9JtocrKGGdKk9c5LtG8WJkIQZyyD8-rU8BPmG4LOTnTfr_HPowRxDtgfRGTTEahG7akRe-HL6QSvsICbzYEXjbIFrgB5AbgLcLhmM_o-HMY5V1MzzDgD295iD-ALgji8XlXLcvny-rU1i_gTWbKOw14C-IJEiitwT1HDT4E_w3E6S18awRvgDcfb6ct3w8538-_0TfgjbrslxSyv32x-wfg8PijGo5rul8A1J4iOp9QjoHo38XN-p9QMIieMwair1oQPWY9bgvgh1z4Aec1JjTzTNrIRPaGSyBFmlCTsjKQRqPJJXMxFHKLOGMIhxP-38eHmLFQv_v-HfHN3pbqqy7sdCd0K1q5o6481PWhKauq3k2dakqpuZCtaIiVtWjLgelGKd5o1oiL2pmOM16zhpelYBWr9wMTbdWUrX5o1VCpCipGszR2b-113vsw7kyMK3VlXR3qemflQDbmecb5y3ABzrf5FrotqhjWMULFrIkpvnCSSZa608tAMu4qrdEY13GkmGUpevwP82W3BttNKS15aOTbPpo0rcNe-XnThb3-_SiW4LNe-TnXsankqZRrx_8KAAD__7OztU4">