aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-02-16 20:19:30 +0100
committerLemonBoy <thatlemon@gmail.com>2020-02-16 21:14:30 +0100
commit6b74fd2e12b117e90197db5f4fa1ea51aa246248 (patch)
tree495e7cb300694b5fdeb01065bc0c1b3b82e83118 /test/compile_errors.zig
parent59a243ce24e858260d289c5c40f3430223b7d98b (diff)
downloadzig-6b74fd2e12b117e90197db5f4fa1ea51aa246248.tar.gz
zig-6b74fd2e12b117e90197db5f4fa1ea51aa246248.zip
ir: Avoid invalidating the decl_table iterator
Collect the declarations to resolve first and run resolve_top_level_decl on them later. Closes #4310
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 6d46afc979..febc936486 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -3,13 +3,13 @@ const builtin = @import("builtin");
const Target = @import("std").Target;
pub fn addCases(cases: *tests.CompileErrorContext) void {
- cases.addTest("access of undefined pointer to array",
- \\const ram_u32: *[4096]u32 = undefined;
- \\export fn entry() void {
- \\ @ptrCast(*u32, &(ram_u32[0])) = &(ram_u32[0]);
+ cases.addTest("",
+ \\const A = B;
+ \\test "Crash" {
+ \\ _ = @typeInfo(@This()).Struct.decls;
\\}
, &[_][]const u8{
- "tmp.zig:3:29: error: use of undefined value here causes undefined behavior",
+ "tmp.zig:1:11: error: use of undeclared identifier 'B'",
});
cases.addTest("duplicate field in anonymous struct literal",