Assert when struct size would exceed 4 GB.

This commit is contained in:
Christoffer Lerno
2025-12-29 22:24:41 +01:00
parent 56f8008d85
commit c949bd3108
4 changed files with 16 additions and 0 deletions

View 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;
}