]> granicus.if.org Git - clang/commitdiff
Consolidated property check into property-typecheck-1.m file.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 17 Dec 2008 17:55:55 +0000 (17:55 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 17 Dec 2008 17:55:55 +0000 (17:55 +0000)
Improved on property diagnostics.
Added a FIXME per Steve's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61141 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
include/clang/Basic/DiagnosticKinds.def
test/SemaObjC/property-typecheck-1.m
test/SemaObjC/property-typecheck-2.m [deleted file]

index c9f5265542bd52b552d9ecf2e179b311ae1ee084..1ccc8a5570af5099dce9cd61fcc1bc20372e7dde 100644 (file)
@@ -277,6 +277,8 @@ class ObjCInterfaceDecl : public NamedDecl, public DeclContext {
   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.
index 7beac265f7c7b1df08178c38de9c1dc59ed45699..1417b8acbdeb964ca81e25a626436cd90b97d75a 100644 (file)
@@ -457,7 +457,7 @@ DIAG(warn_objc_property_default_assign_on_object, WARNING,
 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,
index d5ee8d1b8881e925cdc5e44c7170bd65408a443e..30d56081c5c8b70c7cba2032d40b04c9a7f92c71 100644 (file)
 }
 @end
 
+
+typedef int T[2];
+typedef void (F)(void);
+
+@interface C
+@property(assign) T p2;  // expected-error {{property cannot have array or function type 'T'}}
+
+@property(assign) F f2; // expected-error {{property cannot have array or function type 'F'}}
+
+@end
+
+
diff --git a/test/SemaObjC/property-typecheck-2.m b/test/SemaObjC/property-typecheck-2.m
deleted file mode 100644 (file)
index b8da661..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: clang -fsyntax-only -verify %s
-
-typedef int T[2];
-typedef void (F)(void);
-
-@interface A
-@property(assign) T p2;  // expected-error {{property cannot have type 'T' (array or function type)}}
-
-@property(assign) F f2; // expected-error {{property cannot have type 'F' (array or function type)}}
-
-@end
-