diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-01 15:52:54 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-01 15:52:54 -0700 |
| commit | c89dd15e1be4959800dc7092d7dd4375253db7bc (patch) | |
| tree | ca184ae53592efa21e67128a5f891d642d7f1118 /test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig | |
| parent | 5466e87fce581f2ef90ac23bb80b1dbc05836fc6 (diff) | |
| parent | 2360f8c490f3ec684ed64ff28e8c1fade249070b (diff) | |
| download | zig-c89dd15e1be4959800dc7092d7dd4375253db7bc.tar.gz zig-c89dd15e1be4959800dc7092d7dd4375253db7bc.zip | |
Merge remote-tracking branch 'origin/master' into llvm14
Diffstat (limited to 'test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig')
| -rw-r--r-- | test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig b/test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig new file mode 100644 index 0000000000..e97a098f40 --- /dev/null +++ b/test/cases/compile_errors/pointer_arithmetic_on_pointer-to-array.zig @@ -0,0 +1,14 @@ +export fn foo() void { + var x: [10]u8 = undefined; + var y = &x; + var z = y + 1; + _ = z; +} + +// error +// backend=stage2 +// target=native +// +// :4:15: error: incompatible types: '*[10]u8' and 'comptime_int' +// :4:13: note: type '*[10]u8' here +// :4:17: note: type 'comptime_int' here |
