<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79893>79893</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] No diagnostic for attribute in front of extern declarations
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
accepts-invalid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
philnik777
</td>
</tr>
</table>
<pre>
Clang currently accepts
```c++
template <class>
struct Test {};
[[deprecated]] extern template struct Test<int>;
```
but doesn't diagnose the use of `Test<int>`. I've also tried other attributes and Clang seems to accepts everyhing, even attributes like `[[fallthrough]]`. I'm pretty sure it's actually invalid code that Clang accepts silently. GCC and MSVC reject the code with not super great diagnostics.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxUU0-vmzgQ_zTDZfQiMCHAgcML2az2sL206t3YE3CfYyN7nDbfvoLw0lSyQAya378ZyxjN6Ig6qI5QnTKZePKhmydjnfmo6zobvL53vZVuRJVCIMf2jlIpmjlCfoL8HQ754ygQx-WsVabrbCUTQtkrK2OE8p_Hn8ghKcZvFBmhPkJ9gnJr2p6LlqOmOZCSTBqqE1QnpF9MweET-AUHyt44XhieSJ-iXoGHxKg9RQeiZtRGjs5HQp4IUyT0F4RD_jfeId_hfyDqG6G00SMHQxo9TxRQMgczJKaI0ml8hBSJrhHZf2aEdKNwn4wbQfTLh3vts-aDFtKH5Yu0lqfg0zg9PD_przgHYr5jTIHQMIg6olScpLV3NO4mrdGovF7cSN60fEqIxq5z2-G_fb9q_f_r9x4D_SDFq_2186fhCZ1njGmmgGMg-UyJjYq7R4qZ7krdlq3MqCvq_FAd8kpU2dRdyoMe9kNe1I0Uoi2Kpij10FDTlOW-LZrMdCIX-7wQrcjLSlS79iL31GhFutFF1RLsc7pKY3fW3q47H8bMxJioq9umLTMrB7JxXVUh1OIQyvdL8I7JaRACRA9CbKbftlCWenXKQrdAvg1pjLDPrYkc_5CwYbtegTW2Zde--BfjePEvw0bjcCVd9mXbSU3KyiDZeBezFGw3Mc8RyncQZxDn0fCUhp3yVxDnhXV7vc3BLyMAcV59RhDn1ervAAAA__-Waydn">