r194938 - ObjectiveC ARC. More validation of toll-free bridging of
jahanian
fjahanian at apple.com
Mon Nov 18 16:15:39 PST 2013
On Nov 18, 2013, at 4:13 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Nov 16, 2013, at 3:22 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>
>>
>> -void Test2(CFErrorRef2 cf, NSError *ns, NSString *str) {
>> +void Test2(CFErrorRef2 cf, NSError *ns, NSString *str, Class c) {
>> (void)(NSString *)cf; // expected-warning {{CFErrorRef bridges to NSError, not NSString}}
>> (void)(NSError *)cf; // okay
>> (void)(MyError*)cf; // okay,
>> (void)(CFErrorRef)ns; // okay
>> (void)(CFErrorRef)str; // expected-warning {{NSString cannot bridge to CFErrorRef}}
>> + (void)(Class)cf; // expected-warning {{CFErrorRef bridges to NSError, not 'Class'}}
>> + (void)(CFErrorRef)c; // expected-warning {{'Class' cannot bridge to 'CFErrorRef’}}
>
> ‘Class’ behaves like ‘id’, doesn’t it? Shouldn’t these be accepted without a warning?
Ok. Just that I wasn’t sure and I wanted to be on the cautious side.
- Fariborz
>
> - Doug
>
>> }
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list