Skip to content

Commit 00430ed

Browse files
Merge pull request #76679 from swiftlang/revert-76651-gaborh/lifetimebound-on-ctors
Revert "[cxx-interop] Add test for lifetimebound annotation in ctor"
2 parents 09c7358 + 4285d8a commit 00430ed

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

test/Interop/Cxx/class/nonescapable-lifetimebound.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ struct SWIFT_NONESCAPABLE View {
1616
View() : member(nullptr) {}
1717
View(const int *p [[clang::lifetimebound]]) : member(p) {}
1818
View(const View&) = default;
19-
private:
20-
const int *member;
21-
friend struct OtherView;
22-
};
23-
24-
struct SWIFT_NONESCAPABLE OtherView {
25-
OtherView() : member(nullptr) {}
26-
OtherView(View v [[clang::lifetimebound]]) : member(v.member) {}
27-
OtherView(const OtherView&) = default;
2819
private:
2920
const int *member;
3021
};
@@ -77,15 +68,14 @@ private:
7768
const int *member;
7869
};
7970

80-
// CHECK: sil [clang makeOwner] {{.*}} : $@convention(c) () -> Owner
71+
// CHECK: sil [clang makeOwner] {{.*}}: $@convention(c) () -> Owner
8172
// CHECK: sil [clang getView] {{.*}} : $@convention(c) (@in_guaranteed Owner) -> _scope(0) @autoreleased View
8273
// CHECK: sil [clang getViewFromFirst] {{.*}} : $@convention(c) (@in_guaranteed Owner, @in_guaranteed Owner) -> _scope(0) @autoreleased View
8374
// CHECK: sil [clang getViewFromEither] {{.*}} : $@convention(c) (@in_guaranteed Owner, @in_guaranteed Owner) -> _scope(0, 1) @autoreleased View
8475
// CHECK: sil [clang Owner.handOutView] {{.*}} : $@convention(cxx_method) (@in_guaranteed Owner) -> _scope(0) @autoreleased View
8576
// CHECK: sil [clang Owner.handOutView2] {{.*}} : $@convention(cxx_method) (View, @in_guaranteed Owner) -> _scope(1) @autoreleased View
8677
// CHECK: sil [clang getViewFromEither] {{.*}} : $@convention(c) (@guaranteed View, @guaranteed View) -> _inherit(0, 1) @autoreleased View
8778
// CHECK: sil [clang View.init] {{.*}} : $@convention(c) () -> @out View
88-
// CHECK: sil [clang OtherView.init] {{.*}} : $@convention(c) (@guaranteed View) -> _inherit(0) @out OtherView
8979

9080
//--- test.swift
9181

@@ -101,5 +91,4 @@ public func test() {
10191
let _ = o.handOutView2(v1)
10292
let _ = getViewFromEither(v1, v2)
10393
let defaultView = View()
104-
let _ = OtherView(defaultView)
10594
}

0 commit comments

Comments
 (0)