File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,14 @@ inline ConstSpanOfInt funcWithSafeWrapper2(ConstSpanOfInt s
6262 [[clang::lifetimebound]]) {
6363 return s;
6464}
65+
6566inline ConstSpanOfInt funcWithSafeWrapper3 (const VecOfInt &v
6667 [[clang::lifetimebound]]) {
6768 return ConstSpanOfInt (v.data (), v.size ());
6869}
6970
71+ struct X {
72+ inline void methodWithSafeWrapper (ConstSpanOfInt s [[clang::noescape]]) {}
73+ };
74+
7075#endif // TEST_INTEROP_CXX_STDLIB_INPUTS_STD_SPAN_H
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ import CxxStdlib
1717// CHECK: func funcWithSafeWrapper(_ s: ConstSpanOfInt)
1818// CHECK-NEXT: func funcWithSafeWrapper2(_ s: borrowing ConstSpanOfInt) -> ConstSpanOfInt
1919// CHECK-NEXT: func funcWithSafeWrapper3(_ v: borrowing VecOfInt) -> ConstSpanOfInt
20+ // CHECK: struct X {
21+ // CHECK-NEXT: init()
22+ // CHECK-NEXT: @_alwaysEmitIntoClient public mutating func methodWithSafeWrapper(_ s: Span<CInt>)
23+ // CHECK-NEXT: mutating func methodWithSafeWrapper(_ s: ConstSpanOfInt)
24+ // CHECK-NEXT: }
2025// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper(_ s: Span<CInt>)
2126// CHECK-NEXT: @lifetime(s)
2227// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper2(_ s: borrowing Span<CInt>) -> Span<CInt>
You can’t perform that action at this time.
0 commit comments