| ... | ... | @@ -907,7 +907,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 907 | 907 | , &[_][]const u8{ |
| 908 | 908 | \\pub extern fn foo() void; |
| 909 | 909 | \\pub export fn bar() void { |
| 910 | | \\ var func_ptr: ?*anyopaque = @ptrCast(?*anyopaque, foo); |
| 910 | \\ var func_ptr: ?*anyopaque = @ptrCast(?*anyopaque, &foo); |
| 911 | 911 | \\ var typed_func_ptr: ?*const fn () callconv(.C) void = @intToPtr(?*const fn () callconv(.C) void, @intCast(c_ulong, @ptrToInt(func_ptr))); |
| 912 | 912 | \\ _ = @TypeOf(typed_func_ptr); |
| 913 | 913 | \\} |
| ... | ... | @@ -2726,7 +2726,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2726 | 2726 | \\ return array[@intCast(c_uint, index)]; |
| 2727 | 2727 | \\} |
| 2728 | 2728 | , |
| 2729 | | \\pub const ACCESS = array[@as(c_int, 2)]; |
| 2729 | \\pub const ACCESS = array[@intCast(usize, @as(c_int, 2))]; |
| 2730 | 2730 | }); |
| 2731 | 2731 | |
| 2732 | 2732 | cases.add("cast signed array index to unsigned", |
| ... | ... | @@ -2956,8 +2956,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2956 | 2956 | \\ return 0; |
| 2957 | 2957 | \\} |
| 2958 | 2958 | \\pub export fn bar() void { |
| 2959 | | \\ var f: ?*const fn () callconv(.C) void = foo; |
| 2960 | | \\ var b: ?*const fn () callconv(.C) c_int = baz; |
| 2959 | \\ var f: ?*const fn () callconv(.C) void = &foo; |
| 2960 | \\ var b: ?*const fn () callconv(.C) c_int = &baz; |
| 2961 | 2961 | \\ f.?(); |
| 2962 | 2962 | \\ f.?(); |
| 2963 | 2963 | \\ foo(); |
| ... | ... | @@ -3780,7 +3780,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3780 | 3780 | |
| 3781 | 3781 | cases.add("Demote function that dereference types that contain opaque type", |
| 3782 | 3782 | \\struct inner { |
| 3783 | | \\ _Atomic int a; |
| 3783 | \\ _Atomic int a; |
| 3784 | 3784 | \\}; |
| 3785 | 3785 | \\struct outer { |
| 3786 | 3786 | \\ int thing; |