Consolidated property check into property-typecheck-1.m file.

Improved on property diagnostics.
Added a FIXME per Steve's comments.

llvm-svn: 61141
This commit is contained in:
Fariborz Jahanian 2008-12-17 17:55:55 +00:00
parent 664fda14d3
commit fff8cba8da
4 changed files with 15 additions and 13 deletions

View 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.

View 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,

View File

@ -17,3 +17,15 @@
}
@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

View File

@ -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