[cxx-interop] Disallow import std, require import CxxStdlib

`CxxStdlib` will now be the only accepted module name for the C++ standard library module in Swift.
This commit is contained in:
Egor Zhdan
2023-01-19 18:07:54 +00:00
parent 119ea05625
commit ee6b9b2a67
8 changed files with 23 additions and 22 deletions

View File

@@ -1908,6 +1908,8 @@ StringRef ModuleDecl::ReverseFullNameIterator::operator*() const {
auto *clangModule =
static_cast<const clang::Module *>(current.get<const void *>());
if (!clangModule->isSubModule() && clangModule->Name == "std")
return "CxxStdlib";
return clangModule->Name;
}