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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy `bugprone-forwarding-reference-overload` false positive on `= delete;` constructor
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

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

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

<pre>
    The `bugprone-forwarding-reference-overload` check in clang-tidy will warn even for a `= delete;` constructor:

```cpp
// main.cpp
class Foo {
public:
  // ...

  template <typename T>
  Foo(T&&) = delete;

  // ...
};
```

```bash
clang-tidy -checks=bugprone-* main.cpp

/path/to/main.cpp:5:3: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
    5 |   Foo(T&&) = delete;
      |   ^
```

In our case, we had various templated constructors and it looks like the original author decided to explicitly delete this to warn/prevent somebody making this mistake in the future.

```
$ clang-tidy --version
LLVM (http://llvm.org/):
 LLVM version 17.0.6
  Optimized build.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4zYM_TXyhbDhSP5IDj7MTDZAgV30MmjPssTYbGTJkORM019f2EmczHbRbgMhtiWS4nuPpAyBOovYsPKVlftETrF3vvlGJ_wdjUGftE5fmvcegVV5O3WjdxbTo_Mf0muyXerxiB6twtSd0RsnNatyUD2qE5AFZaTt0kj6Ah9kDHxIbwHPaOHoPMg5KhN70GgwIhOvi7OzIfpJReeZeGH5nuX3_yq_LjWOtx1-YPwAgySbrZvKyBDg4Byw-vW6NU6tIbWGA7g5Zln2fAFAxGE0MiIw8RYvI1o5ILwz8eVucHCO8e0749WydvA5_0_B_nFJvX_Y3LH8EGArQ7-CuTOYLrQGJvarEoy_fAd-5WWUsWf8EB3jh9VEvJRMvAgmXhYpyHbz6xPjIJXCMZLtQMJDZ1h1BiUt9KQRYo-g3HgBaTUM7ozPcQKw8vUnC6bc3wkDKIHVb_BzNMPyu9qz8su_8PqLBTd5UDIg42_wgdBLDWfpyU1h1Vx_BjDDogjGuVMAQ6crYuepIysNXHsFNCrSqCE6wD9HQ4qiudwyhdhTmE9mrmdJ_Fz6EYIbcG4sGORpJncxGyhEecK5a-Z7jlOcPGY_rI67xsVzf6XpGX0gZ6-nX7_-9g0Y3_YxzrJfS9GY85A53y1fu0c7LMY3d9jUWZ5Vd4p_HSMN9BdqaCcyOvsulUQ3Qu_ETibYbOoNr-oNF3XSNzW2AvM2L4_bQh-rWlZKl4UWfMNlXUlMqOE5L_Ii322KPBdFJncb3AlZHlvOq20hWZHjIMlk96wTCmHCZrvd8G1iZIsmLIOL8wcNjPN5kPlmdkrbqQusyA2FGB5hIkWDzRN1_2u2HaUJCKMLFOmM4Ox_DbFk8qaZZQirDh3Ffmoz5YabKLdHOnr3B6rI-GHBGhg_LHD_DgAA__8qFLyk">