<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55962>55962</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Poor diagnostics for use of a template class without providing parameters in some contexts
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
brycelelbach
</td>
</tr>
</table>
<pre>
[Godbolt](https://godbolt.org/z/Y4YY6Gj5W)
```
template <typename T>
struct x;
template <typename T>
constexpr int y = x::a; // Clang diagnostic doesn't mention that `x` is a template.
using z = x; // Clang diagnostic mentions that `x` is a template.
```
In the definition of `y`, Clang complains that `x` isn't a "class, namespace, or enumeration", but fails to mention that it is a class template and no template parameters have been provided.
In other simpler contexts, such as the definition of the using alias `y`, Clang does explain that `x` is a class template and template parameters need to be provided.
We should improve the quality of the diagnostic for the `y` case - it should explain that `x` is a class template and template parameters are missing.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyllE1vnDAQhn8NXEZZsXylHDhssk3UWw-VohwHMyyOvDa1TZLNr-8Y2O4m2aqVKhnQ-OOdx6_HNKY91FFxc2_axigfFdso_dJ7P7go20TpHbfdPLQydsfRGz-P-eNjef9UPERpFSXbKNks7zJZ2hR62g8KPUGU3frDQBr3BD-i7Os87LwdhYfXKLs5F_nLKmG08_Q6WJDaw4FnbYPEhhuyEszMcKtQ76CVuNPGeSmgNeR0lF572JP20mjwPXpg2Fd-QDpAOKZenfOMTrLS2zHRnzMsuu4fhN_7NL-_BSKCljqp5QRouqByCPPS2yWfMEFJfs4y7w2ZLhUKnQtLgnVuQEEhMBZIj3uyGMR5WuhsRg8dSsVy5r0x0s_ok9jvDQDqFrQ5xQNaTuLJOujxmaAh0jBY8yxbalcf9md4gxac5LX85ZPkg_QTqRtFD-guOBB65iNAJXnGJ0fCwQIXRHDlgvUX-C_Ba6I2eNDQZfoHAtebUbXA9DyBJrCfI0P5w5HzrBg6tjt0Lbgg0BFcBVcXmf8mRkuwly5Ys5DGbZ21VVZh7KVXFK71ZBFfavhuGOjE5ybAkZkY_VSfS-4X6RnSL04E78_yMrMzfCWPxxePVtUf_hi8fmxWXKscKPV8_Fyx4BMJzyGDj8RHf1cUVZnGfS2ydJ1VeXGdFMW6q9Y5JlVVViV1SdUWmMUKG1IubIprV9MLTBKhjottLOs0SdOkTKp1mRZZtUIhuhyrvMnpGvMMozyhPRf6KnCEX1ls6wmpGXeOB5V03p0G2QW545qY0rE-juyIrRt7EKRINSj6eMpfT_y_AO18tso">