mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Assert when struct size would exceed 4 GB.
This commit is contained in:
12
test/test_suite/struct/struct_too_large.c3
Normal file
12
test/test_suite/struct/struct_too_large.c3
Normal file
@@ -0,0 +1,12 @@
|
||||
import std;
|
||||
struct Foo
|
||||
{
|
||||
int a;
|
||||
int[int.max] b; // #error: "Struct member 'b' would cause the struct to become too large
|
||||
}
|
||||
|
||||
fn int main()
|
||||
{
|
||||
Foo c = (Foo){};
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user