Skip to content

Commit c01392c

Browse files
committed
fix dangling StringRef
1 parent cd9d5c0 commit c01392c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,9 +2830,10 @@ ClangModuleUnit *ClangImporter::Implementation::getWrapperForModule(
28302830
// Make sure that synthesized Swift code in the clang module wrapper
28312831
// (e.g. _SwiftifyImport macro expansions) can access the same symbols as
28322832
// if it were actually in the clang module
2833-
StringRef moduleName = isCxxStdModule(I) ? SwiftContext.Id_CxxStdlib.str() :
2833+
std::string swiftModuleName = isCxxStdModule(I) ?
2834+
static_cast<std::string>(SwiftContext.Id_CxxStdlib) :
28342835
I->getFullModuleName();
2835-
ImportPath::Builder importPath(SwiftContext, moduleName, '.');
2836+
ImportPath::Builder importPath(SwiftContext, swiftModuleName, '.');
28362837
UnloadedImportedModule importedModule(importPath.copyTo(SwiftContext), ImportKind::Module);
28372838
implicitImportInfo.AdditionalUnloadedImports.push_back(importedModule);
28382839
}

0 commit comments

Comments
 (0)