aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/aggregate_too_large.zig
blob: 4a4daeda939c6711fd1dd31ece3ad396f838815c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const S = struct {
    data: [1 << 32]u8,
};

const T = struct {
    d1: [1 << 31]u8,
    d2: [1 << 31]u8,
};

const U = union {
    a: u32,
    b: [1 << 32]u8,
};

const V = union {
    a: u32,
    b: T,
};

comptime {
    _ = S;
    _ = T;
    _ = U;
    _ = V;
}

// error
//
// :1:11: error: struct layout requires size 4294967296, this compiler implementation supports up to 4294967295
// :5:11: error: struct layout requires size 4294967296, this compiler implementation supports up to 4294967295
// :10:11: error: union layout requires size 4294967300, this compiler implementation supports up to 4294967295