diff options
| author | 2026-10-14 16:10:42 +0330 | |
|---|---|---|
| committer | 2026-10-14 16:10:42 +0330 | |
| commit | a752292b54e22a8024b9d9162762edd2efa533b5 (patch) | |
| tree | c19c48c792237538ae2a393d2af9e15fd2884c55 /tests | |
| parent | unary: u*x, m*x, d*x are not recasts when the tag names a global variable either (diff) | |
fndef: a second definition of a function in the same module is 'is defined twice' (appendix b.2.3)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conformance/known.txt | 1 | ||||
| -rw-r--r-- | tests/langerrors/fn_defined_twice.zc | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/conformance/known.txt b/tests/conformance/known.txt index 13ef43c..ff67f6b 100644 --- a/tests/conformance/known.txt +++ b/tests/conformance/known.txt @@ -5,7 +5,6 @@ 5-declarations/enum_member_names_earlier_b2.zc zy a appendix b.2.2 confirmed: enum members can't name earlier members 5-declarations/fn_prototype_after_definition_b4.zc zy a appendix b.2.4 confirmed: a prototype after the definition hides it 5-declarations/fn_prototype_unnamed_params_b13.zc zy a appendix b.2.13 confirmed (message now: doesn't match its earlier declaration) -5-declarations/fn_redefined_b3.zc zy a appendix b.2.3 confirmed: a plain redefinition silently shadows the first 5-declarations/global_float_init_b7.zc zy a appendix b.2.7 confirmed: float global initializer rejected 5-declarations/include_in_function_b9.zc zy a appendix b.2.9 confirmed: include in a body gives "return outside a function" 9-appendix-b/b2_05_ternary_int_float.zc zy a appendix b.2.5 confirmed diff --git a/tests/langerrors/fn_defined_twice.zc b/tests/langerrors/fn_defined_twice.zc new file mode 100644 index 0000000..7af57e8 --- /dev/null +++ b/tests/langerrors/fn_defined_twice.zc @@ -0,0 +1,4 @@ +// expect: f: is defined twice +int f() { return 1; } +int f() { return 2; } +fn main() { return f(); } |
