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
9696
9797 $(P The value of an $(GLINK EnumMember) is given by its *AssignExpression* if present.
9898 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 `.
100100 If there is no *AssignExpression* and it is not the first $(I EnumMember),
101101 it is given the value of the previous $(I EnumMember)`+1`:)
102102
@@ -109,6 +109,19 @@ f = Foo.E; // OK
109109 value of the previous $(I EnumMember), it is an error. (This can happen
110110 with floating point types).
111111
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+
112125 $(P All $(I EnumMember)s are in scope for the *AssignExpression*s.
113126 )
114127
You can’t perform that action at this time.
0 commit comments