Issue 133439
Summary `-Wextra-semi` should warn about commas at the end of enumerator lists
Labels new issue
Assignees
Reporter SunBlack
    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`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to