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:
parent
664fda14d3
commit
fff8cba8da
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue