<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82499>82499</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Rejects-valid with misleading diagnostic for classes defined in variable templates (`template <int> constexpr struct {} test`)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Eisenwave
</td>
</tr>
</table>
<pre>
```cpp
template <int>
constexpr struct {} test;
```
For this code, clang ouputs:
```
<source>:2:11: error: cannot declare a class template with no name
2 | constexpr struct {} test;
| ^
<source>:2:20: error: expected ';' after struct
2 | constexpr struct {} test;
| ^
| ;
<source>:2:21: error: a type specifier is required for all declarations
2 | constexpr struct {} test;
| ^
3 errors generated.
Compiler returned: 1
```
This diagnostic is incorrect. This is not a class template; this is a variable template of unnamed class type, but the class type here is not a template.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklN9uozoQxp_G3IwagQkhXHCRpM0DHJ0XMPYEvHJs1jOk7duvDG3Sbv9otWtFAWzP-DcfH6OIbO8RW1HtRXWfqYmHENsHS-gf1QWzLpjnVmzy5afHUeT3It8xnkenGEGUB-tZlA_LvA6eGJ_GCMRx0gyi3ov6HhiJRblfNl3TvTzO_8cQgQdLoINBIQ-gnfI9hGmcmES5-zy0PFCYosYEUO6kKHdFIcodYIwhphutvA8MBrVTEUGltERw5X-0PIAP4NUZl5wAABJEfYA_KgbmkbbfhqgevuST-Ts-fBpRMxoQsk45ZQ3qxPh65D8iXUE-o7zhXl_MJ7jv5VTAzyMCjajtyWIESxDx52QjGjiFCMq5F7EV2-Dp7wr4AvRWT7kgEfToMSpGs1oWDuE8WocRIvIUPZpEXXzju_-T54xVvQ_EVqeCrNchRtS8gnnVEiQP_e4dUe4Xx1oCBRcVreoc3qwVTjD55CvzGvg8zs7uJgYe8M0sDBjxds5rilVm2tI0ZaMybIs631ayaTbrbGi1LLZmratNkVedKhol63xT13W3qasamyqzrczlOpeyKKqyketVnUutdbk1sshNgZVY53hW1q2cu5xXIfaZJZqw3cp102ROdeho7gpSenyEeVFImZpEbFPMXTf1JNa5s8R0y8KWHbb_4Q_UTHcX5axZPrKzJYfKWN-_lTt5ZtYBCQyerEcD1n9Uk0DIrdjkHxvP95ba5EI22RRdOzCPcyORRyGPveVh6lY6nIU8JviXy90YQ0IX8jiXTEIeZ0l-BQAA__-mGY-a">