Skip to content

Commit 6707b6d

Browse files
committed
fix dangling StringRef
1 parent 7bf335a commit 6707b6d

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

0 commit comments

Comments
 (0)