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

    <tr>
        <th>Summary</th>
        <td>
            misc-include-cleaner false positive when ADL finds a function at 2nd phase of two-phase name lookup
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          geza-herman
      </td>
    </tr>
</table>

<pre>
    For this 4-file setup, clang-tidy reports that `bar.hpp` is unused in `main.cpp`. But this is incorrect, it is necessary for the example to compile.

```c++
// main.cpp
#include "call_bar.hpp"
#include "bar.hpp"
#include "base.hpp"

int main() {
    return call_bar(Base());
}
```

```c++
// call_bar.hpp
#ifndef CALL_BAR_HPP
#define CALL_BAR_HPP

template <typename T>
int call_bar(T t) {
    return bar(t);
}

#endif
```

```c++
// bar.hpp
#ifndef BAR_HPP
#define BAR_HPP

#include "base.hpp"

int bar(Base) {
    return 0;
}

#endif
```

```c++
// base.hpp
#ifndef BASE_HPP
#define BASE_HPP

struct Base {};

#endif
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lE-PszYQxj-NuYxAYMeQHDgkm4162MOq3fvKMUNwa2xkD7tNP30FIfunzbarV3ql0USZZ_A8P0ZYxWhODrFmcsfkPlEjdT7UJ_xLpR2GXrnk6JtzffABqDMRVmlrLEJEGgfG70Bb5U4pmeYMAQcfKAJ1ioCV-VGFrBsGVuZgIoxujNiAcZPUK-MyPWsZ7Ea6nD2F0z4E1DSdbWgqOdQYowpnaGcTCPin6geLQB607wdjMWP5nuXbJZf5JTTjuykuVX5g_ABvk5eiME7bsUFgnGtl7fPVNee3Wv5PjfhZnrNxNM9lfM34Bli1WAIACEhjcHAdzfh6pyJeOqcQV_vV_h9030b-hPXmunUNtnC3fXh43m1_ff7l8fFNa7A1Dm9pcybsB6sIgYk7Og_oVI_wxMT9O-0HnCegr6AvDXQb82oGXWPaH0X_gvoL4Bus397vx93dps1_HuTi6l-Uv93fxvxUn3OkMGqCyf9svtq_u_0vk0lTi2YjNirBuqhEsc7lqpBJV5eVLNdKroQuG7HZNGUpRS5FJaeutuSJqXnOV0VRVHmRCyEzla83opW6alCWQh7ZKsdeGZtZ-9JnPpwSE-OIdVGUsqgSq45o43xvce7wFWZ12ozcJ6GeHkqP4ymyVW5NpPh-DBmyWPcm6nTZbaotKocBWmUjwuCjIfOC8Nqhg-3-AVrjmggK2tFpMt6BIuCugaGbXphvgV59evkzfw3W-z_GIRmDrTuiITKxLOtkqBuPmfY944fJ0fKTDsH_Pl97h5kjMn5YQF9q_ncAAAD__wx7mn0">