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
[Moved to DR at the September, 2013 meeting.]
In an enumeration whose underlying type is not fixed, the type of the first enumerator is unspecified if it has no initializer, meaning that an implementation could choose either a signed or an unsigned type. As a result, the values of one and two in this example could be either -1 and 0 or very large unsigned numbers:
enum { zero, one = zero -1, two };
It would be better if 9.7.1 [dcl.enum] paragraph 5 specified the type of the first enumerator as a signed type.
Proposed resolution (August, 2013):
Change 9.7.1 [dcl.enum] paragraph 5 as follows:
...If the underlying type is not fixed, the type of each enumerator is the type of its initializing value:
If an initializer is specified for an enumerator...
If no initializer is specified for the first enumerator, the initializing value has an unspecified signed integral type.
Otherwise...