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

    <tr>
        <th>Summary</th>
        <td>
            [include-cleaner] Attribution of uses of explicit specializations
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-include-cleaner
      </td>
    </tr>

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

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

<pre>
    Currently all specializations are attributed to the primary template, we should make sure explicit specializations get attributed to the relevant pattern instead, e.g.:

a.h:
```
#pragma once
template <typename T> struct Foo{};
```
b.h:
```
#pragma once
#include "a.h"
template <> struct Foo<int> {};
```
use.cc:
```
#include "b.h"
void foo() { Foo<int> x; }
```

here use.cc shouldn't have any missing or unused includes.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk99uozoQh5_G3IyCiB1CuOCiSU6e4LzAYA_gU2Mje5zT7NOvSLNqt-1WWgnZYiT_vs9_BlOyoyfqRH0U9bnAzFOI3TMaGzVx0Qdz6045RvLsboDOQVpIW3T2B7INPgFGAmSOts9MBjgATwRLtDPGGzDNi0MmIU_wP0GaQnYGZnwmSDkS0MvirLb8KXYk_iI2kqMreoYFmSl6sD4xoVnjqRxLoZ5EdRbVY8Ryeqvsq8f3-ivVEnGcEYLX9Fr7JQtCnfi2kMeZ4F-h_oHEMWuGSwiiOYrmLNTxy9T-74BCKuu1y4ZASLnaSvlZ5YOAOlnPa-17lZyo1Pobm3fk_h35GqyBIQQhD0K2K-R36otQR1i5X8bex4kiwSv_ceNeyIZhwisB-hvMNiXrRwgRss-JDDxkUlmYTplWtVhQt903bd3IupXF1DVyaHcGD83QaLMdhkO726HRhx6Hpq3aQ2E7WUlVKam223qvZNnStjVat7Jvhsr0UuwqmtG60rnrXIY4FjalTN1-u69l4bAnl-6NIKV26MfNQ2qjHaGnuB5RfS5it67f9HlMYlc5mzi9JbJld--mj2vrMzw9nrMNHsKwHlBa5z-1QJGj6ybmJa2XKC9CXkbLU-5LHWYhLyvzMW2WGP4jzUJe7ltKQl7uu_oZAAD__6ECMl8">