[cfe-commits] r61141 - in /cfe/trunk: include/clang/AST/DeclObjC.h include/clang/Basic/DiagnosticKinds.def test/SemaObjC/property-typecheck-1.m test/SemaObjC/property-typecheck-2.m

Fariborz Jahanian fjahanian at apple.com
Wed Dec 17 09:56:08 PST 2008


Author: fjahanian
Date: Wed Dec 17 11:55:55 2008
New Revision: 61141

URL: http://llvm.org/viewvc/llvm-project?rev=61141&view=rev
Log:
Consolidated property check into property-typecheck-1.m file.
Improved on property diagnostics.
Added a FIXME per Steve's comments.

Removed:
    cfe/trunk/test/SemaObjC/property-typecheck-2.m
Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/include/clang/Basic/DiagnosticKinds.def
    cfe/trunk/test/SemaObjC/property-typecheck-1.m

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=61141&r1=61140&r2=61141&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Dec 17 11:55:55 2008
@@ -277,6 +277,8 @@
   Type *TypeForDecl;
   friend class ASTContext;
   
+  // FIXME: We should be able to get away with this slot by saving the
+  // record decl. build lazily in a map.
   RecordDecl *RecordForDecl;
   
   /// Class's super class.

Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=61141&r1=61140&r2=61141&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Dec 17 11:55:55 2008
@@ -457,7 +457,7 @@
 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)")
+     "property cannot have array or function type %0")
 DIAG(err_objc_directive_only_in_protocol, ERROR,
      "directive may only be specified in protocols only")
 DIAG(err_missing_catch_finally, ERROR,

Modified: cfe/trunk/test/SemaObjC/property-typecheck-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-typecheck-1.m?rev=61141&r1=61140&r2=61141&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/property-typecheck-1.m (original)
+++ cfe/trunk/test/SemaObjC/property-typecheck-1.m Wed Dec 17 11:55:55 2008
@@ -17,3 +17,15 @@
 }
 @end
 
+
+typedef int T[2];
+typedef void (F)(void);
+
+ at interface C
+ at property(assign) T p2;  // expected-error {{property cannot have array or function type 'T'}}
+
+ at property(assign) F f2; // expected-error {{property cannot have array or function type 'F'}}
+
+ at end
+
+

Removed: cfe/trunk/test/SemaObjC/property-typecheck-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-typecheck-2.m?rev=61140&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/property-typecheck-2.m (original)
+++ cfe/trunk/test/SemaObjC/property-typecheck-2.m (removed)
@@ -1,12 +0,0 @@
-// RUN: clang -fsyntax-only -verify %s
-
-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
-





More information about the cfe-commits mailing list