File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
lib/ClangImporter/SwiftBridging/swift Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 103
103
#define SWIFT_UNSAFE_REFERENCE \
104
104
__attribute__ ((swift_attr(" import_reference" ))) \
105
105
__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(retain:immortal)))) \
106
- __attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(release:immortal))))
106
+ __attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(release:immortal)))) \
107
+ __attribute__((swift_attr(" unsafe" )))
107
108
108
109
// / Specifies a name that will be used in Swift for this declaration instead of its original name.
109
110
#define SWIFT_NAME (_name ) __attribute__((swift_name(#_name)))
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ struct SWIFT_ESCAPABLE Owner {};
28
28
29
29
struct Unannotated { } ;
30
30
31
+ struct SWIFT_UNSAFE_REFERENCE UnsafeReference { } ;
32
+
31
33
//--- test.swift
32
34
33
35
import Test
@@ -36,6 +38,10 @@ import CoreFoundation
36
38
func useUnsafeParam( x: Unannotated ) { // expected-warning{{reference to unsafe struct 'Unannotated'}}
37
39
}
38
40
41
+ @available ( macOS 13 . 4 , * )
42
+ func useUnsafeParam2( x: UnsafeReference ) { // expected-warning{{reference to unsafe class 'UnsafeReference'}}
43
+ }
44
+
39
45
func useSafeParams( x: Owner , y: View ) {
40
46
}
41
47
You can’t perform that action at this time.
0 commit comments