| ... | ... | @@ -5292,25 +5292,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5292 | 5292 | "tmp.zig:2:30: error: cannot set section of local variable 'foo'", |
| 5293 | 5293 | }); |
| 5294 | 5294 | |
| 5295 | | cases.add("returning address of local variable - simple", |
| 5296 | | \\export fn foo() *i32 { |
| 5297 | | \\ var a: i32 = undefined; |
| 5298 | | \\ return &a; |
| 5299 | | \\} |
| 5300 | | , &[_][]const u8{ |
| 5301 | | "tmp.zig:3:13: error: function returns address of local variable", |
| 5302 | | }); |
| 5303 | | |
| 5304 | | cases.add("returning address of local variable - phi", |
| 5305 | | \\export fn foo(c: bool) *i32 { |
| 5306 | | \\ var a: i32 = undefined; |
| 5307 | | \\ var b: i32 = undefined; |
| 5308 | | \\ return if (c) &a else &b; |
| 5309 | | \\} |
| 5310 | | , &[_][]const u8{ |
| 5311 | | "tmp.zig:4:12: error: function returns address of local variable", |
| 5312 | | }); |
| 5313 | | |
| 5314 | 5295 | cases.add("inner struct member shadowing outer struct member", |
| 5315 | 5296 | \\fn A() type { |
| 5316 | 5297 | \\ return struct { |