mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Prevent circular initializers.
This commit is contained in:
3
test/test_suite/globals/recursive_globals.c3
Normal file
3
test/test_suite/globals/recursive_globals.c3
Normal file
@@ -0,0 +1,3 @@
|
||||
void *x = &x;
|
||||
|
||||
int y = 1 + y; // #error: This looks like the initialization of the variable was circular.
|
||||
5
test/test_suite/globals/self_referencing_local.c3
Normal file
5
test/test_suite/globals/self_referencing_local.c3
Normal file
@@ -0,0 +1,5 @@
|
||||
fn void test()
|
||||
{
|
||||
void* x = &x;
|
||||
int y = y; // #error: This looks like the initialization of the variable was circular.
|
||||
}
|
||||
Reference in New Issue
Block a user