File tree 1 file changed +19
-15
lines changed 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -1471,21 +1471,25 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
1471
1471
\\}
1472
1472
});
1473
1473
1474
- cases .add ("type referenced struct" ,
1475
- \\struct Foo {
1476
- \\ struct Bar{
1477
- \\ int b;
1478
- \\ };
1479
- \\ struct Bar c;
1480
- \\};
1481
- , &[_ ][]const u8 {
1482
- \\pub const struct_Bar = extern struct {
1483
- \\ b: c_int,
1484
- \\};
1485
- \\pub const struct_Foo = extern struct {
1486
- \\ c: struct_Bar,
1487
- \\};
1488
- });
1474
+ if (builtin .os != .windows ) {
1475
+ // When clang uses the <arch>-windows-none triple it behaves as MSVC and
1476
+ // interprets the inner `struct Bar` as an anonymous structure
1477
+ cases .add ("type referenced struct" ,
1478
+ \\struct Foo {
1479
+ \\ struct Bar{
1480
+ \\ int b;
1481
+ \\ };
1482
+ \\ struct Bar c;
1483
+ \\};
1484
+ , &[_ ][]const u8 {
1485
+ \\pub const struct_Bar = extern struct {
1486
+ \\ b: c_int,
1487
+ \\};
1488
+ \\pub const struct_Foo = extern struct {
1489
+ \\ c: struct_Bar,
1490
+ \\};
1491
+ });
1492
+ }
1489
1493
1490
1494
cases .add ("undefined array global" ,
1491
1495
\\int array[100] = {};
You can’t perform that action at this time.
0 commit comments