Skip to content

Commit d20eb63

Browse files
authored
Merge pull request #79943 from swiftlang/gaborh/remove-feature-guard
[cxx-interop] Remove last LifetimeDependence guard in C++ interop
2 parents ccac295 + f887365 commit d20eb63

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8950,11 +8950,8 @@ void ClangImporter::Implementation::swiftify(FuncDecl *MappedDecl) {
89508950
attachMacro = true;
89518951
}
89528952
bool returnHasLifetimeInfo = false;
8953-
bool lifetimeDependenceOn =
8954-
SwiftContext.LangOpts.hasFeature(Feature::LifetimeDependence);
89558953
if (SwiftDeclConverter::getImplicitObjectParamAnnotation<
8956-
clang::LifetimeBoundAttr>(ClangDecl) &&
8957-
lifetimeDependenceOn) {
8954+
clang::LifetimeBoundAttr>(ClangDecl)) {
89588955
printer.printLifetimeboundReturn(SwiftifyInfoPrinter::SELF_PARAM_INDEX,
89598956
true);
89608957
returnHasLifetimeInfo = true;
@@ -8976,8 +8973,7 @@ void ClangImporter::Implementation::swiftify(FuncDecl *MappedDecl) {
89768973
printer.printNonEscaping(index);
89778974
paramHasLifetimeInfo = true;
89788975
}
8979-
if (clangParam->hasAttr<clang::LifetimeBoundAttr>() &&
8980-
lifetimeDependenceOn) {
8976+
if (clangParam->hasAttr<clang::LifetimeBoundAttr>()) {
89818977
printer.printLifetimeboundReturn(
89828978
index, !paramHasBoundsInfo &&
89838979
swiftParam->getInterfaceType()->isEscapable());

test/Interop/Cxx/stdlib/std-span-interface.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-ide-test -plugin-path %swift-plugin-dir -I %S/Inputs -enable-experimental-feature LifetimeDependence -enable-experimental-feature SafeInteropWrappers -print-module -module-to-print=StdSpan -source-filename=x -enable-experimental-cxx-interop -Xcc -std=c++20 -module-cache-path %t > %t/interface.swift
2+
// RUN: %target-swift-ide-test -plugin-path %swift-plugin-dir -I %S/Inputs -enable-experimental-feature SafeInteropWrappers -print-module -module-to-print=StdSpan -source-filename=x -enable-experimental-cxx-interop -Xcc -std=c++20 -module-cache-path %t > %t/interface.swift
33
// RUN: %FileCheck %s < %t/interface.swift
44

55
// REQUIRES: swift_feature_SafeInteropWrappers
6-
// REQUIRES: swift_feature_LifetimeDependence
76

87
// FIXME swift-ci linux tests do not support std::span
98
// UNSUPPORTED: OS=linux-gnu

0 commit comments

Comments
 (0)