File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ f = Foo.E; // OK
96
96
97
97
$(P The value of an $(GLINK EnumMember) is given by its *AssignExpression* if present.
98
98
If there is no *AssignExpression* and it is the first $(I EnumMember),
99
- its value is $(GLINK EnumBaseType)`.init `.
99
+ its value is converted to $(GLINK EnumBaseType) from `0 `.
100
100
If there is no *AssignExpression* and it is not the first $(I EnumMember),
101
101
it is given the value of the previous $(I EnumMember)`+1`:)
102
102
@@ -109,6 +109,19 @@ f = Foo.E; // OK
109
109
value of the previous $(I EnumMember), it is an error. (This can happen
110
110
with floating point types).
111
111
112
+ $(SPEC_RUNNABLE_EXAMPLE_FAIL
113
+ ---
114
+ enum E : char
115
+ {
116
+ a,
117
+ b = char.max,
118
+ c // overflow
119
+ }
120
+
121
+ static assert(E.a == 0);
122
+ ---
123
+ )
124
+
112
125
$(P All $(I EnumMember)s are in scope for the *AssignExpression*s.
113
126
)
114
127
You can’t perform that action at this time.
0 commit comments