<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63292>63292</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
"attribute does not appear on the first declaration" gives wrong line for template specialization
</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>
For example:
```
int a();
// CHECK: [[@LINE-1]]:5 note: previous declaration is here
[[clang::internal_linkage]] int a() { return 1; }
template <typename> int b();
// CHECK: [[@LINE+1]]:44 note: previous declaration is here
template<> [[clang::internal_linkage]] int b<int>() { return 1; }
```
The error for b gives the previous declaration to its own line which is not helpful.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUks-umzwQxZ9m2IxuBGMgYcEif_V9atVV95WBCbh1bGQPN719-gqS9mZxpSqSBULGZ87v-OgYTe-Yayh2UBwSPcngQ62boNuBJWl891affED-qS-jZVBbSA-QbqFM7-v2uTyNE9RAG6AK1O5xB-gEdML9f8f9J1BbXMbtIE8____l-JJBcZiX2hbovMxTcAz8avwUsePW6qDFeIcm4sCB75qLRmu162dbah7PwWn7zRr3Q_d8U8UHVwjrHQaWKTjMQO0Q1odHm8KX0WphBLWXt5GdvjCo4yLRPA8GtHtHy_Mn2P4YAbWf5z-D2oDaGyegjv9k_ugOvw6MHIIPePYBG-zNK0eUgT92LR6NRPRXh9Y4xutg2mFmcV5wYDueJ7tKulp1lap0wnVWbsqyKspikwx1QWWVUalUW3YdnfWmyFRLqm3yrFs3HSemppRUWmaKSOXZZqVUptYprzOqyrbINOQpX7SxK2tfLysf-sTEOHFdKqoosbphG5dyEzm-4rIJRHPXQz2feWmmPkKeWhMlvquIEcs1EGmRYJpJGDvPNyw9jqwDzvQD49mEKI-ZANE9tWvwrr_lMof5t11x5NZoa34t_ydTsPUgMsb5bpc-9UaGqVm1_gJ0mj3dXy9j8N-5FaDTQhKBTgvp7wAAAP__l_gksg">