diff options
Diffstat (limited to 'doc/c23.md')
-rw-r--r-- | doc/c23.md | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -40,6 +40,28 @@ and hexadecimal, using syntax like `0b01101011`. C23 allows empty initializers to initialize an object as if it had static storage duration. +## [N3029]: Improved Normal Enumerations + +C23 allows enumerators outside the range of `int`. When an enum +type contains such an enumerator, its type during processing of the +enum is the type of the initializing expression, or the type of the +previous enumerator if there is no initializing expression. In the +latter case, if the type of the previous enumerator can't represent +the current value, an integer type with the same signedness capable +of representing the value is chosen. Outside of an enum containing +a large enumerator, the types of all enumerators are changed to the +the enum type. + +## [N3030]: Enhanced Enumerations + +C23 allows enum types with fixed underlying types using syntax like +`enum E : unsigned long`. These enum types are compatible with the +underlying type, and all enumerator constants have the enum type. + +Enum types with fixed underlying types are complete by the end of +the underlying type specifier, so they can be forward-declared and +used inside the enum. + [N2265]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2265.pdf [N2418]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2418.pdf [N2508]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf |