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

Chris Lattner clattner at apple.com
Tue Dec 16 22:47:08 PST 2008


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"?

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?

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