Skip to content

Commit 1b8ba84

Browse files
committed
fix dangling StringRef
1 parent 229280f commit 1b8ba84

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
@@ -2799,9 +2799,10 @@ ClangModuleUnit *ClangImporter::Implementation::getWrapperForModule(
27992799
// Make sure that synthesized Swift code in the clang module wrapper
28002800
// (e.g. _SwiftifyImport macro expansions) can access the same symbols as
28012801
// if it were actually in the clang module
2802-
StringRef moduleName = isCxxStdModule(I) ? SwiftContext.Id_CxxStdlib.str() :
2802+
std::string swiftModuleName = isCxxStdModule(I) ?
2803+
static_cast<std::string>(SwiftContext.Id_CxxStdlib) :
28032804
I->getFullModuleName();
2804-
ImportPath::Builder importPath(SwiftContext, moduleName, '.');
2805+
ImportPath::Builder importPath(SwiftContext, swiftModuleName, '.');
28052806
UnloadedImportedModule importedModule(importPath.copyTo(SwiftContext), ImportKind::Module);
28062807
implicitImportInfo.AdditionalUnloadedImports.push_back(importedModule);
28072808
}

0 commit comments

Comments
 (0)