[cfe-commits] r61090 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/SemaDeclObjC.cpp test/SemaObjC/property-typecheck-2.m

Fariborz Jahanian fjahanian at apple.com
Wed Dec 17 09:22:57 PST 2008


On Dec 16, 2008, at 10:47 PM, Chris Lattner wrote:

> On Dec 16, 2008, at 9:51 AM, Fariborz Jahanian wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=61090&view=rev
>> Log:
>> Patch to check for ObjC's property type.
>
> Cool.
>
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
>> +++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Tue Dec 16  
>> 11:51:01 2008
>> @@ -456,6 +456,8 @@
>>     "default property attribute 'assign' not appropriate for non-gc  
>> object")
>> DIAG(err_objc_property_requires_object, ERROR,
>>     "property with '%0' attribute must be of object type")
>> +DIAG(err_property_type, ERROR,
>> +     "property cannot have type %0 (array or function type)")
>
> How about "property cannot have array or function type %0"?

OK will do.
>
>
> That would read better.
>
>> @@ -0,0 +1,12 @@
>> +// RUN: clang -fsyntax-only -verify %s
>
> Can this test be merged into other files?  I'd prefer to not have  
> one file for each specific issue, rather have one file for each  
> class of language construct.  maybe the property-typecheck cases can  
> all be in one test file?

I would like to keep the test cases per feature. This makes regression  
checking a lot easier (a test failure will tell  which feature it  
failed).
I have a concern about putting every new ObjC feature test in the same  
file. This will make diagnosis of a regression very hard. Are
you suggesting that all ObjC sema checking goes into one single file?


- Fariborz
>
>
> Splitting up into separate files is useful when you need different  
> options passed to clang -verify (e.g. things like -std=c89).
>
> Thanks Fariborz!
>
> -Chris
>
>>
>> +
>> +typedef int T[2];
>> +typedef void (F)(void);
>> +
>> + at interface A
>> + at property(assign) T p2;  // expected-error {{property cannot have  
>> type 'T' (array or function type)}}
>> +
>> + at property(assign) F f2; // expected-error {{property cannot have  
>> type 'F' (array or function type)}}
>> +
>> + at end
>> +
>>
>>
>> _______________________________________________
>> 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