Skip to content

Commit 1513df6

Browse files
committed
[cxx-interop][nfc] Fix test fallout.
1 parent fcd7289 commit 1513df6

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

test/Interop/Cxx/class/fixit-add-safe-to-import-self-contained.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public func test(x: X) {
3434
// CHECK: SAFE_TO_IMPORT
3535

3636
// CHECK: note: Mark type 'Ptr' as 'SELF_CONTAINED' in C++ to make methods that use it available in Swift.
37-
// CHECK: struct X {
37+
// CHECK: struct Ptr {
3838
// CHECK: ^
3939
// CHECK: SELF_CONTAINED
4040
x.other()

test/Interop/Cxx/class/invalid-class-errors.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ struct Nested {
2727

2828
import Test
2929

30-
// CHECK: note: record 'A' is not automatically importable: does not have a copy constructor or destructor. Refer to the C++ Interop User Manual to classify this type.
30+
// CHECK: note: record 'A' is not automatically available: does not have a copy constructor or destructor. Does this type have reference semantics?
31+
// CHECK: struct A {
32+
// CHECK: ^
33+
// CHECK: SWIFT_REFERENCE_TYPE(<#retain#>, <#release#>)
3134
public func test(x: A) { }
32-
// CHECK: note: record 'B' is not automatically importable: does not have a copy constructor or destructor. Refer to the C++ Interop User Manual to classify this type.
35+
// CHECK: note: record 'B' is not automatically available: does not have a copy constructor or destructor. Does this type have reference semantics?
36+
// CHECK: struct {{.*}}B {
37+
// CHECK: ^
38+
// CHECK: SWIFT_REFERENCE_TYPE(<#retain#>, <#release#>)
3339
public func test(x: B) { }
34-
// CHECK: note: record 'Nested' is not automatically importable: does not have a copy constructor or destructor. Refer to the C++ Interop User Manual to classify this type.
35-
public func test(x: Namespace.Nested) { }
40+
// CHECK: note: record 'Nested' is not automatically available: does not have a copy constructor or destructor. Does this type have reference semantics?
41+
// CHECK: struct Nested {
42+
// CHECK: ^
43+
// CHECK: SWIFT_REFERENCE_TYPE(<#retain#>, <#release#>)
44+
public func test(x: Namespace.Nested) { }

test/Interop/Cxx/class/invalid-unsafe-projection-errors.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ import Test
2929
public func test(x: M) {
3030
// CHECK: note: C++ method 'test1' that returns a pointer of type 'UnsafeMutablePointer' is unavailable.
3131
// CHECK: note: C++ method 'test1' may return an interior pointer.
32-
// CHECK: note: Mark method 'test1' as 'safe_to_import' in C++ to make it available in Swift.
32+
// CHECK: note: Mark method 'test1' as 'SAFE_TO_IMPORT' in C++ to make it available in Swift.
3333
x.test1()
3434
// CHECK: note: C++ method 'test2' that returns a reference of type 'UnsafeMutablePointer' is unavailable.
3535
// CHECK: note: C++ method 'test2' may return an interior pointer.
36-
// CHECK: note: Mark method 'test2' as 'safe_to_import' in C++ to make it available in Swift.
36+
// CHECK: note: Mark method 'test2' as 'SAFE_TO_IMPORT' in C++ to make it available in Swift.
3737
x.test2()
3838
// CHECK: note: C++ method 'test3' that returns a value of type 'Ptr' is unavailable.
3939
// CHECK: note: C++ method 'test3' may return an interior pointer.
40-
// CHECK: note: Mark method 'test3' as 'safe_to_import' in C++ to make it available in Swift.
41-
// CHECK: note: Mark type 'Ptr' as 'self_contained' in C++ to make methods that use it available in Swift.
40+
// CHECK: note: Mark method 'test3' as 'SAFE_TO_IMPORT' in C++ to make it available in Swift.
41+
// CHECK: note: Mark type 'Ptr' as 'SELF_CONTAINED' in C++ to make methods that use it available in Swift.
4242
x.test3()
4343
// CHECK: note: C++ method 'begin' that returns an iterator is unavailable
4444
// CHECK: note: C++ methods that return iterators are potentially unsafe. Try re-writing to use Swift iterator APIs.

0 commit comments

Comments
 (0)