diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conformance/2-types/enum_names_own_member.zc | 8 | ||||
| -rw-r--r-- | tests/conformance/known.txt | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/conformance/2-types/enum_names_own_member.zc b/tests/conformance/2-types/enum_names_own_member.zc index 26d4739..1a49106 100644 --- a/tests/conformance/2-types/enum_names_own_member.zc +++ b/tests/conformance/2-types/enum_names_own_member.zc @@ -1,4 +1,8 @@ -// expect error: expected a constant +// expect: 17/3/6/ +// spec 2.8.1: a member is defined as soon as it is declared; a later value can name it include rt; +void pn(int x) { rt.put_n(x); rt.put_c(10); } enum e { HI = 16, LO = HI + 1 }; -fn main() { return 0; } +enum f { A, B, C, D = C + 1, E = D * 2 }; +fn main() { pn(LO); pn(D); pn(E); return 0; } +// zc0: skip diff --git a/tests/conformance/known.txt b/tests/conformance/known.txt index 22a1e3d..723098a 100644 --- a/tests/conformance/known.txt +++ b/tests/conformance/known.txt @@ -2,7 +2,6 @@ # class a: self-hosted compiler bug; b: zc0 deviation (appendix a/b); c: spec issue to settle # appendix b.2.8 (a global named in an initializer is its address) is documented behavior per 5.3.2 and 3.14.2: no entry 4-statements/o3_outside_function_ordinary_block.zc zy c top-level o3 { } is rejected; spec 4.10.2 says it is an ordinary block -5-declarations/enum_member_names_earlier_b2.zc zy c appendix b.2.2 confirmed, but spec 2.8.1 documents it (members are defined at the closing brace); not fixed, like b.2.8 the spec body wins until decided 5-declarations/fn_prototype_unnamed_params_b13.zc zy c spec 5.2.1 says prototype parameter names are required, and a type name alone is read as an untyped parameter of that name (paramstart); b.2.13 is a spec choice, not fixed 9-appendix-b/b2_06_bool_normalises.zc zy c appendix b.2.6 confirmed, but spec 2.1 documents bool as a number that is not normalised 9-appendix-b/b2_10_recovery_hides_errors.zc zy c appendix b.2.10 confirmed; by design per 8.2 |
