<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/133439>133439</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`-Wextra-semi` should warn about commas at the end of enumerator lists
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SunBlack
</td>
</tr>
</table>
<pre>
For stylistic reasons, we want it to be consistently in the code that enumerators do not have an extra comma at the end.
So he should warn about the extra `,` here, e.g.,:
```cpp
enum MyEnum
{
A,
B,
};
```
[`-Wc++98-compat-pedantic`](https://clang.llvm.org/docs/DiagnosticsReference.html#id155) contains a warning [for this](https://godbolt.org/z/faq7Wqnob):
```
warning: commas at the end of enumerator lists are incompatible with C++98
```
But there exists no way to say I only want the warning for the unnecessary comma, but not the other warnings. So a warning `-Wc++98-compat-enumerator-semi` would be nice, which is then also included in `-Wextra-semi`.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMU8uOmzwUfhqzOQoCc0lYsAiTH-lfdNNZzNqYE-zW2BnbDKVPX9lJOtHMLCohYdnn9l0Oc05OGrElVUeqU8IWL4xtnxfdKcZ_JoMZt7Y3FpzflHRecrDInNGO0CdYEVamPUgP3sCAwI120nnUXm0gNXgR7kYEL5gH1MuMlnljHYwGtPEg2BsC04C_vGXAzTwzYD7moR5Tkh1Jdnw2IBCcMIsaYWVWAxvMcouKiaTOCH0idQYCLYbRMJ3ScFWEAuE5fvxyIdkxzAHftv_0MofHfRfbNMcQH0_d7bQ_kaJ7zL_OE7iqs90LJ7QjtGsOO27mC_O7C45Me8lDZHUi9CC8v7gwA-0J7bliekqVeptTYydC-9FwR2h_kmzSJpDrvuMZLWqOqfCzIrSQY15VhDaBWs-kdsAiBVJPQKrubCx4Id1X7SYzDkb5W6_fhPZn9rp_edVmILT5wAzJjreypDhehXAPSoA5P8gHwQoOmEWQ-opdDgphlV7A052Vz8R1V9FskC1W0AZWtgXzOLbB_2C02q6WCn3vOK8gERatkaNzzG7XCYPQw-Kjk0KACcXvaS6FZ_PI1peSvYPaOZxlsNAafTYgaMmjl1YhuQDpQg8NTDkTYKtlxDGYPBaOPryXSJOxLcamaFiCbb4vi7yumn2ViLamWVNjXeKZn0tsyiEb87poaDaM-6aqaSJbmtEqK-ghp2WdV2lT1zXP60NT82pPc07KDGcm1V8fJdK5Bdu8KMqiSRQbULm4zpRqXCG-EkrDdts2JO2GZXKkzKKI72W89Arbz2C-WLx_skeyWNV-cKT0YhlSbmZC-9D49ttdrPmB3BPax3HDUtzwvLX0TwAAAP__uPt8JA">