diff options
Diffstat (limited to 'test/SemaObjC/default-synthesize-1.m')
-rw-r--r-- | test/SemaObjC/default-synthesize-1.m | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/test/SemaObjC/default-synthesize-1.m b/test/SemaObjC/default-synthesize-1.m index c201e74..5aaca9a 100644 --- a/test/SemaObjC/default-synthesize-1.m +++ b/test/SemaObjC/default-synthesize-1.m @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -Wobjc-missing-property-synthesis -verify -Wno-objc-root-class %s +// rdar://11295716 @interface NSObject - (void) release; @@ -7,21 +8,21 @@ @class NSString; @interface SynthItAll : NSObject -@property int howMany; -@property (retain) NSString* what; +@property int howMany; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} +@property (retain) NSString* what; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} @end -@implementation SynthItAll +@implementation SynthItAll // expected-note 2 {{detected while default synthesizing properties in class implementation}} //@synthesize howMany, what; @end @interface SynthSetter : NSObject -@property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair -@property (nonatomic, retain) NSString* what; +@property (nonatomic) int howMany; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} +@property (nonatomic, retain) NSString* what; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} @end -@implementation SynthSetter +@implementation SynthSetter // expected-note 2 {{detected while default synthesizing properties in class implementation}} //@synthesize howMany, what; - (int) howMany { @@ -37,11 +38,11 @@ @interface SynthGetter : NSObject -@property (nonatomic) int howMany; // REM: nonatomic to avoid warnings about only implementing one of the pair -@property (nonatomic, retain) NSString* what; +@property (nonatomic) int howMany; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} +@property (nonatomic, retain) NSString* what; // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} @end -@implementation SynthGetter +@implementation SynthGetter // expected-note 2 {{detected while default synthesizing properties in class implementation}} //@synthesize howMany, what; // - (int) howMany @@ -114,3 +115,12 @@ } @end +@interface rdar11333367 +@property enum A x; // expected-note {{forward declaration of 'enum A'}} expected-note {{property declared here}} +@property struct B y; // expected-note {{forward declaration of 'struct B'}} expected-note {{property declared here}} \ + // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} +@end +@implementation rdar11333367 // expected-error {{cannot synthesize property 'y' with incomplete type 'struct B'}} \ + // expected-note {{detected while default synthesizing properties in class implementation}} +@synthesize x; // expected-error {{cannot synthesize property 'x' with incomplete type 'enum A'}} +@end |