authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-10 16:57:37-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-10 16:57:37-04:00
log2933d6b8489b8dc5c07bfb503578b12d0d783350
treea98a9ea13d55fb979ea37efbfb1cbf2c538bfd00
parentfee0e6c8b9d676ef785aab52d25b19ed64e9adeb
signature Commit is signed but in an unrecognized format.

add test case for previous commit

closes #2467

1 files changed, 10 insertions(+), 0 deletions(-)

test/compile_errors.zig+10
...@@ -2,6 +2,16 @@ const tests = @import("tests.zig");...@@ -2,6 +2,16 @@ const tests = @import("tests.zig");
2const builtin = @import("builtin");2const builtin = @import("builtin");
33
4pub fn addCases(cases: *tests.CompileErrorContext) void {4pub fn addCases(cases: *tests.CompileErrorContext) void {
5 cases.add(
6 "peer cast then implicit cast const pointer to mutable C pointer",
7 \\export fn func() void {
8 \\ var strValue: [*c]u8 = undefined;
9 \\ strValue = strValue orelse c"";
10 \\}
11 ,
12 "tmp.zig:3:32: error: cast discards const qualifier",
13 );
14
5 cases.add(15 cases.add(
6 "attempt to cast enum literal to error",16 "attempt to cast enum literal to error",
7 \\export fn entry() void {17 \\export fn entry() void {