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
AST: making export: true in @_specialized attribute a no-operation
The client code doesn't actually call into these specialized functions even
though they have public linkage. This could lead to TBD verification failure
shown in rdar://44777994.
This patch also warns users' codebase when `export: true` is specified.
@_specialize(kind: partial, where X == Int, Y == Int)
144
144
@_specialize(kind:, where X == Int, Y == Int)
145
145
146
-
@_specialize(exported:true, kind: partial, where X == Int, Y == Int)
147
-
@_specialize(exported:true, exported:true, where X == Int, Y == Int) // expected-error{{parameter 'exported' was already defined in '_specialize' attribute}}
148
-
@_specialize(kind: partial, exported:true, where X == Int, Y == Int)
146
+
@_specialize(exported:true, kind: partial, where X == Int, Y == Int) // expected-warning{{'exported: true' has no effect in '_specialize' attribute}}
147
+
@_specialize(exported:true, exported:true, where X == Int, Y == Int) // expected-error{{parameter 'exported' was already defined in '_specialize' attribute}} expected-warning2{{'exported: true' has no effect in '_specialize' attribute}}
148
+
@_specialize(kind: partial, exported:true, where X == Int, Y == Int) // expected-warning{{'exported: true' has no effect in '_specialize' attribute}}
149
149
@_specialize(kind: partial, kind: partial, where X == Int, Y == Int) // expected-error{{parameter 'kind' was already defined in '_specialize' attribute}}
150
150
151
151
@_specialize(where X == Int, Y == Int, exported:true, kind: partial) // expected-error{{use of undeclared type 'exported'}} expected-error{{use of undeclared type 'kind'}} expected-error{{use of undeclared type 'partial'}} expected-error{{expected type}}
@@ -200,22 +200,22 @@ public func simpleGeneric<T>(t: T) -> T {
200
200
}
201
201
202
202
203
-
@_specialize(exported:true, where S: _Trivial(64))
203
+
@_specialize(exported:true, where S: _Trivial(64)) // expected-warning{{'exported: true' has no effect in '_specialize' attribute}}
204
204
// Check that any bitsize size is OK, not only powers of 8.
205
205
@_specialize(where S: _Trivial(60))
206
-
@_specialize(exported:true, where S: _RefCountedObject)
206
+
@_specialize(exported:true, where S: _RefCountedObject) // expected-warning{{'exported: true' has no effect in '_specialize' attribute}}
0 commit comments