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 103103#define SWIFT_UNSAFE_REFERENCE \
104104 __attribute__ ((swift_attr(" import_reference" ))) \
105105 __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" )))
107108
108109// / Specifies a name that will be used in Swift for this declaration instead of its original name.
109110#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 {};
2828
2929struct Unannotated { } ;
3030
31+ struct SWIFT_UNSAFE_REFERENCE UnsafeReference { } ;
32+
3133//--- test.swift
3234
3335import Test
@@ -36,6 +38,10 @@ import CoreFoundation
3638func useUnsafeParam( x: Unannotated ) { // expected-warning{{reference to unsafe struct 'Unannotated'}}
3739}
3840
41+ @available ( macOS 13 . 4 , * )
42+ func useUnsafeParam2( x: UnsafeReference ) { // expected-warning{{reference to unsafe class 'UnsafeReference'}}
43+ }
44+
3945func useSafeParams( x: Owner , y: View ) {
4046}
4147
You can’t perform that action at this time.
0 commit comments