Skip to content

Commit bbd48ff

Browse files
committed
ImportC: add section on enums
1 parent d9bf60f commit bbd48ff

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/importc.dd

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,26 @@ $(H2 $(LNAME2 preprocessor-directives, Preprocessor Directives))
112112
directives are normally embedded in the output of C preprocessors.)
113113

114114

115+
$(H2 $(LNAME2 implementation, Implementation))
116+
117+
$(P The implementation defined characteristics of ImportC are:)
118+
119+
$(H3 $(LNAME2 enums, Enums))
120+
121+
$(P $(I enumeration-constants) are always typed as `int`.)
122+
123+
$(P The expression that defines the value of an $(I enumeration-constant) must
124+
be an integral type and evaluate to an integer value that fits in an `int`.)
125+
126+
---
127+
enum E { -10, 0x81231234 }; // ok
128+
enum F { 0x812312345678 }; // error, doesn't fit in int
129+
enum G { 1.0 }; // error, not integral type
130+
---
131+
132+
$(P The enumerated type is `int`.)
133+
134+
115135
$(H2 $(LNAME2 limitations, Limitations))
116136

117137
$(H3 $(LNAME2 exceptions, Exception Handling))

0 commit comments

Comments
 (0)