chatwyn added a comment.

Hi:
we're in the process of testing with Clang 10 and noticed a behavior change 
caused by this commit.

Consider the following piece of code:

  @protocol P
  @end
  
  @protocol Q
  @end
  
  @interface I <P,Q>
  @end
  
  void a() {
      void (^genericBlockWithParam)(id <P>);
      void (^blockWithParam)(I *);
      blockWithParam = genericBlockWithParam;
      genericBlockWithParam = blockWithParam;
  }

when I use clang 9, it will be  below error

  incompatible block pointer types assigning to 'void (^__strong)(I *__strong)' 
from 'void (^__strong)(__strong id<P>)'
      blockWithParam = genericBlockWithParam;
                     ^ ~~~~~~~~~~~~~~~~~~~~~

but in clang 10, the error is that

  incompatible block pointer types assigning to 'void (^__strong)(__strong 
id<P>)' from 'void (^__strong)(I *__strong)'
  genericBlockWithParam = blockWithParam;
                     ^ ~~~~~~~~~~~~~~~~~~~~~

I think clang 9 is reasonable.


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
  • [PATCH] D66831: [ObjC] Fi... ChatWyn via Phabricator via cfe-commits

Reply via email to