Skip to content

Commit 331e57a

Browse files
authored
Merge pull request #60282 from hyp/i/newafterstdlib
[interop][SwiftToCxx] include <new> after <stdlib.h> (fixes local tests)
2 parents 07f728d + 32f2b71 commit 331e57a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ static void writePrologue(raw_ostream &out, ASTContext &ctx,
102102
out << "#include <cstdint>\n"
103103
"#include <cstddef>\n"
104104
"#include <cstdbool>\n"
105-
"#include <cstring>\n"
106-
"#include <new>\n";
105+
"#include <cstring>\n";
107106
out << "#include <stdlib.h>\n";
107+
out << "#include <new>\n";
108108
out << "#if defined(_WIN32)\n#include <malloc.h>\n#endif\n";
109109
},
110110
[&] {

test/PrintAsCxx/empty.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
// CHECK-NEXT: #include <cstddef>
3030
// CHECK-NEXT: #include <cstdbool>
3131
// CHECK-NEXT: #include <cstring>
32-
// CHECK-NEXT: #include <new>
3332
// CHECK-NEXT: #include <stdlib.h>
33+
// CHECK-NEXT: #include <new>
3434
// CHECK-NEXT: #if defined(_WIN32)
3535
// CHECK-NEXT: #include <malloc.h>
3636
// CHECK-NEXT: #endif

0 commit comments

Comments
 (0)