| author | |
| committer | |
| log | 69dd10144fc723d8006f2e563fc3edd82ee4b368 |
| tree | 48d71ac751a794a5f1e048c6de19dc62543c97ff |
| parent | 3e26b9e957887e55e99046e908bc07200140d3f8 |
Closes #358022 files changed, 5 insertions(+), 2 deletions(-)
src/Sema.zig+1-1| ... | @@ -25675,7 +25675,6 @@ pub fn explainWhyTypeIsNotExtern( | ... | @@ -25675,7 +25675,6 @@ pub fn explainWhyTypeIsNotExtern( |
| 25675 | 25675 | ||
| 25676 | .@"opaque", | 25676 | .@"opaque", |
| 25677 | .bool, | 25677 | .bool, |
| 25678 | .float, | ||
| 25679 | .@"anyframe", | 25678 | .@"anyframe", |
| 25680 | => unreachable, // these *are* allowed | 25679 | => unreachable, // these *are* allowed |
| 25681 | 25680 | ||
| ... | @@ -25684,6 +25683,7 @@ pub fn explainWhyTypeIsNotExtern( | ... | @@ -25684,6 +25683,7 @@ pub fn explainWhyTypeIsNotExtern( |
| 25684 | try sema.errNote(src_loc, msg, "SPIR-V runtime arrays must be the last field of an extern struct", .{}); | 25683 | try sema.errNote(src_loc, msg, "SPIR-V runtime arrays must be the last field of an extern struct", .{}); |
| 25685 | }, | 25684 | }, |
| 25686 | 25685 | ||
| 25686 | .float => try sema.errNote(src_loc, msg, "'{f}' is not extern compatible on this target", .{ty.fmt(pt)}), | ||
| 25687 | .pointer => if (ty.isSlice(zcu)) { | 25687 | .pointer => if (ty.isSlice(zcu)) { |
| 25688 | try sema.errNote(src_loc, msg, "slices have no guaranteed in-memory representation", .{}); | 25688 | try sema.errNote(src_loc, msg, "slices have no guaranteed in-memory representation", .{}); |
| 25689 | } else { | 25689 | } else { |
src/Type.zig+4-1| ... | @@ -3122,7 +3122,6 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool | ... | @@ -3122,7 +3122,6 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool |
| 3122 | 3122 | ||
| 3123 | .@"opaque", | 3123 | .@"opaque", |
| 3124 | .bool, | 3124 | .bool, |
| 3125 | .float, | ||
| 3126 | .@"anyframe", | 3125 | .@"anyframe", |
| 3127 | => true, | 3126 | => true, |
| 3128 | 3127 | ||
| ... | @@ -3144,6 +3143,10 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool | ... | @@ -3144,6 +3143,10 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool |
| 3144 | 24, 48 => zcu.getTarget().cpu.arch == .ez80, | 3143 | 24, 48 => zcu.getTarget().cpu.arch == .ez80, |
| 3145 | else => false, | 3144 | else => false, |
| 3146 | }, | 3145 | }, |
| 3146 | .float => switch (ty.floatBits(zcu.getTarget())) { | ||
| 3147 | else => true, | ||
| 3148 | 80 => zcu.getTarget().cTypeBitSize(.longdouble) == 80, | ||
| 3149 | }, | ||
| 3147 | .@"fn" => { | 3150 | .@"fn" => { |
| 3148 | if (position != .other) return false; | 3151 | if (position != .other) return false; |
| 3149 | return validateExternCallconv(ty.fnCallingConvention(zcu)); | 3152 | return validateExternCallconv(ty.fnCallingConvention(zcu)); |