<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/101181>101181</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `performance-unnecessary-value-param` false positive with iterator as template parameter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          firewave
      </td>
    </tr>
</table>

<pre>
    ```cpp
#include <list>

template<class Iterator>
void func(Iterator it)
{
}

void f()
{
 std::list<int> l;
    func(l.rbegin());
}
```

``` 
<source>:4:20: warning: the parameter 'it' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
    4 | void func(Iterator it)
 |                    ^
      |           const &
```
https://godbolt.org/z/611TeePzP
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU81uqzwQfZphM0rkHwiwYJGfRvp2XXwvYMyQ-F7HRrZJ1D79FSQ0VVvp3igC4zmec86MR8VoTo6ogWIHxSFTYzr70PQm0E1dKWt999bAht3_ehiAHYBtQUjjtB07QpB7a2IC-fIIzc9El8GqRCD32qoY8b9EQSUfPnBXbzrsR6dBVEsQTQJRP_KUu2Vx-Jz5fg5E9R2JMXUgtyC3d0V74yZdaEEuCMSF065DSyfjHplE_QF6Ei6-P_N_bOLjW-6jH4OmyZnc5iC3goHc4k0FZ9xpWqYz4aCCulCigCDKyWeJJqL2g6EOex-QlD6jcVevVTLeYTsm9M6-4RipQxVRofYuJgzUUyA3Me7mLdNRwIv6bdwJTfqOQyh2A4Xeh4tymlajc6QpRhXeVldlR1rN4qA4PKuUI5R7_FuTZtAPPyhenqnwC-quDsTmxyqfUxri1EVxBHE8-a71Nq19OIE4voM4bjj_n-j1_TXrGtnVslYZNbwUQuZ5yXl2boquzllV1WwjqeKyY1TUrO51Xre17qnITCOYyFkpGZes4Hyd56rsqkr1XFVM5RxyRhdl7Nra62XizkyMIzWccV7xzKqWbJxHRghHN5yjIMQ0QaGZDq3a8RQhZ9NFjM80ySRL0zz9Szs2DHtlI-Hgo0nmSngz6Yxm6YOKuIzZ83ZlY7DNlxqadB7btfYXEMdJyuO1GoL_RTqBOM4GIojjw-G1EX8CAAD__2zwOHU">