Created on 2013-02-03.00:00:00 last changed 121 months ago
[Moved to DR at the September, 2013 meeting.]
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...
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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-11-24 00:00:00 | admin | set | status: drwp -> c++14 |
2014-03-03 00:00:00 | admin | set | status: dr -> drwp |
2013-10-14 00:00:00 | admin | set | messages: + msg4686 |
2013-10-14 00:00:00 | admin | set | status: tentatively ready -> dr |
2013-09-03 00:00:00 | admin | set | messages: + msg4457 |
2013-09-03 00:00:00 | admin | set | status: open -> tentatively ready |
2013-02-03 00:00:00 | admin | create |