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

    <tr>
        <th>Summary</th>
        <td>
            Template arguments can't be used in attributes
        </td>
    </tr>

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

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

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

<pre>
    ```
constexpr int constexpr_var = 101;
[[gnu::constructor(constexpr_var)]] void a() {}

template <int TemplateArg>
[[gnu::constructor(TemplateArg)]] void b() {}

template void b<101>();
```
This code compiles fine with gcc, and clang can successfully compile `a` but errors on `b` with "'constructor' attribute requires an integer constant".

Note clang doesn't error on the instantiation of b but rather on the template definition. so even if the `template void b<101>();` line is removed clang still gives an error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU0tvuzgQ_zTDZdTIjAOEA4emaY576n1lzABeOXbWj3T77VcQ-sipfykKspnf_B4zqBjN5Jg7qI5QnQqV0-xDp_qg9Myp6P3w0UEttp84gXjW3sXE_10DGpfw6_T3TQUEecJSlCCP99q17XFyGeQzyDs0ZJ18ADo8QIFaqE5QnfDmzYAK6ADUIjRHaE5bs_U_8eVqVWIE-bIIeNvOz2EC-foHtD8Bj6T976RbnXxZXb7eAd92H5N6m01E7QdG7S9XYzniaBzju0kzTloDvaByA2qr3IRaOYxZa45xzNZ-fIIQaqGgFtjnhByCDxG9W2775XZtBkRAzYPPBlVKwfQ5MQb-N5vAEZVbhsYTh_vglEtAtPtp9S-feFM0eI4OqNloF9Y0M5o70KhkvEM_Yr9KCyrN_FX0ldjAo3FmKd1h9Mg3dmjGtQZq8XuwtUC7hGYiBr74G3_mFZOxFidzu_taJe6KoZNDK1tVcFfWbSXbqjkcirmrRkViP2hVNnuSTCQPIw2SdVNqyeOhMB0JkqIlKquypsNOVBWTqhom2Wret7AXfFHG7qy9XXY-TIWJMXNXN2W1L6zq2cb1OyJy_I7ry2Uu1akI3YJ56vMUYS-siSl-d0kmWe4-txJVmPKFXYrLQqzh94w58oDGfY80FjnYbk7pGpcdpzPQeTJpzv1O-wvQeWm_PZ6uwf_DOgGdV1ER6LyK_j8AAP__adNC-w">