This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


518. Trailing comma following enumerator-list

Section: 9.7.1  [dcl.enum]     Status: CD1     Submitter: Charles Bryant     Date: 10 May 2005

[Voted into WP at April, 2006 meeting.]

The C language (since C99), and some C++ compilers, accept:

    enum { FOO, };

as syntactically valid. It would be useful

This proposed change is to permit a trailing comma in enum by adding:

enum identifieropt { enumerator-list , }

as an alternative definition for the enum-specifier nonterminal in 9.7.1 [dcl.enum] paragraph 1.

Proposed resolution (October, 2005):

Change the grammar in 9.7.1 [dcl.enum] paragraph 1 as indicated:

enum-specifier: