You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cxx-interop] Enabling WarnUnannotatedReturnOfCxxFrt on by default and add it to a diagnostic group
This change makes the warning for unannotated C++ functions returning foreign
reference types (FRT) enabled by default, improving memory safety for Swift/C++
interop users. Also added CxxForeignReferenceType diagnostic group for better control
inline SharedFRT* createSharedFRT() { returnnewSharedFRT(); }// expected-note {{'createSharedFRT()' is defined here}}
67
67
68
68
//--- module.modulemap
69
69
module CxxTest {
@@ -109,7 +109,7 @@ public func returnSharedFRT(_ x : SharedFRT) -> SharedFRT {
109
109
}
110
110
111
111
public func returnSharedFRT2() -> SharedFRT {
112
-
returncreateSharedFRT()
112
+
returncreateSharedFRT()// expected-warning {{cannot infer the ownership of the returned value, annotate 'createSharedFRT()' with either SWIFT_RETURNS_RETAINED or SWIFT_RETURNS_UNRETAINED}}
0 commit comments