[interop][SwiftToCxx] check that generics can be built in C++17/C++14 mode

This commit is contained in:
Alex Lorenz
2022-11-01 16:39:50 -07:00
parent 953c124ceb
commit 4b52ae08fa
14 changed files with 97 additions and 64 deletions

View File

@@ -359,3 +359,16 @@ void ClangSyntaxPrinter::printIncludeForShimHeader(StringRef headerName) {
void ClangSyntaxPrinter::printDefine(StringRef macroName) {
os << "#define " << macroName << "\n";
}
void ClangSyntaxPrinter::printIgnoredDiagnosticBlock(
StringRef diagName, llvm::function_ref<void()> bodyPrinter) {
os << "#pragma clang diagnostic push\n";
os << "#pragma clang diagnostic ignored \"-W" << diagName << "\"\n";
bodyPrinter();
os << "#pragma clang diagnostic pop\n";
}
void ClangSyntaxPrinter::printIgnoredCxx17ExtensionDiagnosticBlock(
llvm::function_ref<void()> bodyPrinter) {
printIgnoredDiagnosticBlock("c++17-extensions", bodyPrinter);
}