The trailing comma after the last member enumis optional. This, apparently, was done to help automatically generate code that can just spit things out without thinking about grammar.
Whether a comma is present or not does not change anything.
Take a look at the grammar:
:
attributes opt enum-modifiersopt enum identifier enum-baseopt enum-body ; opt
:
: integral-type
:
{ enum-member-declarationsopt}
{ enum-member-declarations , }
- :
enum-member-declaration
enum-member-declarations , enum-member-declaration
-:
attributes opt identifier
attributes opt identifier = constant-expression
, enum-body .