diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-09-19 14:36:41 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-09-20 00:50:13 +0300 |
| commit | 541b3e3a31946475f29d21e7a742bf80c5952791 (patch) | |
| tree | 4516d103301ab7913786679f3f2e988bf7029eb5 /test/behavior/struct.zig | |
| parent | fb91483e48fe6cfa21edc613f266e27bd6bf9dbf (diff) | |
| download | zig-541b3e3a31946475f29d21e7a742bf80c5952791.tar.gz zig-541b3e3a31946475f29d21e7a742bf80c5952791.zip | |
Sema: check pointer qualifiers before implicit cast
Closes #12881
Diffstat (limited to 'test/behavior/struct.zig')
| -rw-r--r-- | test/behavior/struct.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig index e0be677b3c..7a650e1a33 100644 --- a/test/behavior/struct.zig +++ b/test/behavior/struct.zig @@ -521,7 +521,7 @@ test "packed struct fields are ordered from LSB to MSB" { if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO var all: u64 = 0x7765443322221111; - var bytes: [8]u8 = undefined; + var bytes: [8]u8 align(@alignOf(Bitfields)) = undefined; @memcpy(&bytes, @ptrCast([*]u8, &all), 8); var bitfields = @ptrCast(*Bitfields, &bytes).*; |
