jyknight added a comment.

In D66831#2019125 <https://reviews.llvm.org/D66831#2019125>, @vsapsai wrote:

> Agree that is a mistake in `NSItemProvider` API. The solution I offer is not 
> to revert the change but to add cc1 flag 
> `-fcompatibility-qualified-id-block-type-checking` and to make the driver for 
> Darwin platforms to add this flag. Thus developers using Apple SDKs will see 
> the old behavior and won't need to change their code. While everybody else 
> will use clang with correct type checking. If any other platforms provide 
> APIs relying on the old type checking, the solution for them is to tweak the 
> driver.
>
> The right `NSItemProvider` fix is to use `__kindof`, like `void (^)(__kindof 
> id<NSSecureCoding> item, NSError *error);` It's purpose is to flip 
> substitution principle, so that's the way to express API requirements in the 
> type system. When we have a fix available in SDK, we can change the driver 
> not to add the compatibility flag anymore and `NSItemProvider` should keep 
> working without developers changing their code.
>
> I'm going to work on the patch to add the compatibility flag, if you have any 
> scenarios not covered by the offered solution, please let me know.


Sounds like a fine plan.

I'm not sure whether there's anyone using objective-c blocks other than with 
the Apple SDKs on Darwin platforms, so your proposal seems basically equivalent 
to just entirely disabling the check, temporarily. But that's ok.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66831/new/

https://reviews.llvm.org/D66831



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to