- Title
- Trailing comma following enumerator-list
- Status
- cd1
- Section
- 9.8.1 [dcl.enum]
- Submitter
- Charles Bryant
Created on 2005-05-10.00:00:00 last changed 217 months ago
Messages
Date: 2006-04-15.00:00:00
[Voted into WP at April, 2006 meeting.]
Date: 2005-10-15.00:00:00
Proposed resolution (October, 2005): Change the grammar in 9.8.1 [dcl.enum] paragraph 1 as
indicated:
enum-specifier:
enum identifieropt { enumerator-listopt }
enum identifieropt { enumerator-list , }
Date: 2005-05-10.00:00:00
The C language (since C99), and some C++ compilers, accept: as syntactically valid. It would be useful for machine generated code for minimising changes when editing to allow a distinction between the final item being intended as
an ordinary item or as a limit: This proposed change is to permit a trailing comma in enum by adding: as an alternative definition for the enum-specifier nonterminal
in 9.8.1 [dcl.enum] paragraph 1.
enum { FOO, };
enum { red, green, blue, num_colours }; // note no comma
enum { fred, jim, sheila, }; // last is not special
enum identifieropt { enumerator-list , }
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
| 2006-11-05 00:00:00 | admin | set | status: dr -> wp |
| 2006-04-22 00:00:00 | admin | set | messages: + msg1364 |
| 2006-04-22 00:00:00 | admin | set | status: ready -> dr |
| 2005-10-22 00:00:00 | admin | set | messages: + msg1220 |
| 2005-10-22 00:00:00 | admin | set | status: open -> ready |
| 2005-05-10 00:00:00 | admin | create | |