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

    <tr>
        <th>Summary</th>
        <td>
            `-Wdocumentation` misleading diagnostic with template specialzation
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
#include <type_traits>

/// @brief brief
/// @tparam T type
template <class T, class = void>
constexpr auto var = T{};

/// @brief brief
/// @tparam T integral type
template <class T>
constexpr auto var<T, std::enable_if_t<std::is_integral_v<T>>> = T{}
```

```sh
<source>:9:6: warning: '@tparam' command used in a comment that is not attached to a template declaration [-Wdocumentation]
    9 | /// @tparam T integral type
      |      ^~~~~~
1 warning generated.
```

https://godbolt.org/z/Gx9bfYf4W

The documentation is still useful in the specialization.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycU92OszYQfZrhZrQR2BCSCy5IdtMXiPSpV5HBE3BlMLKH7M9Fn70yZLParVpVtSyw5_ecY40KwXQjUQXFAYrnRM3cO185a27kLVHSOP1ewTZddztNkNYgpBlbO2tCkEd-n-jCXhkOIF-iO0ac1o2Qp403dMXl-9PFk_JqwDPGIpDWTMNkFS91W6tCwDOII65HkM94c0avXVo3Bqa3yaOa2eFN-SXgDOUBymeQh_-JxIxMnVf23yD9AwCQxwVuYA2yBlnTqBpLF3O9MMjjw2zC5bPL5bYkyZd1f6OQ1g_d71w-r6GPN3kMbvYtLan1HmS9BVnjq_KjGbt4BFE-qIEosXXDoEaNcyCNZkS1WGhk5F4xmoCjY1TMqu1JIztU-OCvqbXKKzZuRCgOT7-0a-eYvJigiIAREfcI5RH_m7i4rBi_HoqXP-OCtM4-eWBHI3nFpDd_V6RnnkIUdWnVOd04yxvnOxCnDxCn3972zfX3a_5rDT_3hN9QR8qBjbVRkutsoyjcE4aJWqOs-ViiNomupN7LvUqoysoiFWVWZEXSV1tV7Pa5KLeiLRu65mUqSYqizXa6yXb7XWIqkYoi3Wa7bCezotjInNJcNzoVDe0akUGe0qCM3Vh7GyLyxIQwU5XleVkWiVUN2bBMpxAjveLiBSHisPoqJj01cxcgT60JHL7KsGFLcXJ_PtQ2xcEES0pHdbVR3egCmxZfDfdfz32XYFUgmb2tfohtuJ-bTesGEKfY9f57mrz7g1oGcVqwBhCnO5lbJf4KAAD__--QXwI">