| ... | @@ -2,6 +2,16 @@ const tests = @import("tests.zig"); | ... | @@ -2,6 +2,16 @@ const tests = @import("tests.zig"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | | 3 | |
| 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { | 4 | pub 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 { |