Skip to content

Extract a new warning -Wc++98-compat-enumerator-comma from -Wc++98-compat-pedantic #133439

Closed
@SunBlack

Description

@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.,:

enum MyEnum
{
	A,
	B,
};

-Wc++98-compat-pedantic contains a warning for this:

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-comma would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions