[cfe-commits] r146737 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/nsobject-attribute.m

John McCall rjmccall at apple.com
Tue Dec 20 11:45:57 PST 2011


On Dec 17, 2011, at 10:08 AM, Fariborz Jahanian wrote:
> On Dec 16, 2011, at 5:27 PM, Eli Friedman wrote:
>> On Fri, Dec 16, 2011 at 7:54 AM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>>> Author: fjahanian
>>> Date: Fri Dec 16 09:54:29 2011
>>> New Revision: 146737
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=146737&view=rev
>>> Log:
>>> objc: after issuing the warning on direct use of __attribute__((NSObject))
>>> on properties, prevent consequential error  diagnostics. // rdar://10591336
>>> 
>>> 
>>> Modified: cfe/trunk/test/SemaObjC/nsobject-attribute.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nsobject-attribute.m?rev=146737&r1=146736&r2=146737&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/test/SemaObjC/nsobject-attribute.m (original)
>>> +++ cfe/trunk/test/SemaObjC/nsobject-attribute.m Fri Dec 16 09:54:29 2011
>>> @@ -45,8 +45,7 @@
>>> {
>>>   __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
>>> }
>>> - at property (nonatomic, retain) __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}} \
>>> -                                // expected-error {{property with 'retain (or strong)' attribute must be of object type}}
>>> + at property (nonatomic, retain) __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
>>> @end
>>> void test_10453342() {
>>>    char* __attribute__((NSObject)) string2 = 0; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
>> 
>> If it suppresses an error, we clearly aren't ignoring the attribute...
>> printing this warning in this case makes no sense.
> 
> I could change the text the warning to say that it is not being ignored (or perhaps being deprecated). But I would like John to comment on this. This warning was initiated
> by his radar.

We should accept this attribute without warning on property declarations of "CF-like" pointer type.  Use isCARCBridgeableType().

John.



More information about the cfe-commits mailing list