diff options
Diffstat (limited to 'test/SemaObjC')
-rw-r--r-- | test/SemaObjC/arc-repeated-weak.mm | 26 | ||||
-rw-r--r-- | test/SemaObjC/arc-system-header.m | 13 | ||||
-rw-r--r-- | test/SemaObjC/arc-unavailable-for-weakref.m | 30 | ||||
-rw-r--r-- | test/SemaObjC/arc.m | 11 | ||||
-rw-r--r-- | test/SemaObjC/attr-availability.m | 32 | ||||
-rw-r--r-- | test/SemaObjC/deprecated-objc-introspection.m (renamed from test/SemaObjC/warn-isa-ref.m) | 16 | ||||
-rw-r--r-- | test/SemaObjC/format-arg-attribute.m | 2 | ||||
-rw-r--r-- | test/SemaObjC/format-strings-objc.m | 6 | ||||
-rw-r--r-- | test/SemaObjC/message.m | 12 | ||||
-rw-r--r-- | test/SemaObjC/method-conflict-2.m | 22 | ||||
-rw-r--r-- | test/SemaObjC/property-category-4.m | 105 | ||||
-rw-r--r-- | test/SemaObjC/property-category-impl.m | 5 | ||||
-rw-r--r-- | test/SemaObjC/property-deprecated-warning.m | 38 | ||||
-rw-r--r-- | test/SemaObjC/property-noninherited-availability-attr.m | 14 | ||||
-rw-r--r-- | test/SemaObjC/property-user-setter.m | 2 | ||||
-rw-r--r-- | test/SemaObjC/property.m | 5 | ||||
-rw-r--r-- | test/SemaObjC/protocol-lookup-2.m | 23 | ||||
-rw-r--r-- | test/SemaObjC/typo-correction.m | 5 | ||||
-rw-r--r-- | test/SemaObjC/warn-missing-super.m | 2 |
19 files changed, 329 insertions, 40 deletions
diff --git a/test/SemaObjC/arc-repeated-weak.mm b/test/SemaObjC/arc-repeated-weak.mm index e652bee..b5d9002 100644 --- a/test/SemaObjC/arc-repeated-weak.mm +++ b/test/SemaObjC/arc-repeated-weak.mm @@ -327,6 +327,32 @@ void doWhileLoop(Test *a) { } @end +@interface Base1 +@end +@interface Sub1 : Base1 +@end +@interface Sub1(cat) +-(id)prop; +@end + +void test1(Sub1 *s) { + use([s prop]); + use([s prop]); +} + +@interface Base1(cat) +@property (weak) id prop; +@end + +void test2(Sub1 *s) { + // This does not warn because the "prop" in "Base1(cat)" was introduced + // after the method declaration and we don't find it as overridden. + // Always looking for overridden methods after the method declaration is expensive + // and it's not clear it is worth it currently. + use([s prop]); + use([s prop]); +} + class Wrapper { Test *a; diff --git a/test/SemaObjC/arc-system-header.m b/test/SemaObjC/arc-system-header.m index 3443bda..d9392ed 100644 --- a/test/SemaObjC/arc-system-header.m +++ b/test/SemaObjC/arc-system-header.m @@ -1,30 +1,30 @@ -// silly workaround expected-note {{marked unavailable here}} // RUN: %clang_cc1 -fobjc-arc -isystem %S/Inputs %s -DNO_USE // RUN: %clang_cc1 -fobjc-arc -isystem %S/Inputs %s -verify -// another silly workaround expected-note {{marked unavailable here}} #include <arc-system-header.h> #ifndef NO_USE void test(id op, void *cp) { cp = test0(op); // expected-error {{'test0' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}} cp = *test1(&op); // expected-error {{'test1' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}} +// expected-note@arc-system-header.h:1 {{marked unavailable here}} +// expected-note@arc-system-header.h:5 {{marked unavailable here}} } -// workaround expected-note {{marked unavailable here}} void test3(struct Test3 *p) { p->field = 0; // expected-error {{'field' is unavailable: this system declaration uses an unsupported type}} + // expected-note@arc-system-header.h:14 {{marked unavailable here}} } -// workaround expected-note {{marked unavailable here}} void test4(Test4 *p) { p->field1 = 0; // expected-error {{'field1' is unavailable: this system declaration uses an unsupported type}} + // expected-note@arc-system-header.h:19 {{marked unavailable here}} p->field2 = 0; } -// workaround expected-note {{marked unavailable here}} void test5(struct Test5 *p) { p->field = 0; // expected-error {{'field' is unavailable: this system field has retaining ownership}} + // expected-note@arc-system-header.h:25 {{marked unavailable here}} } id test6() { @@ -38,12 +38,13 @@ id test6() { x = (id) (test6_helper(), kMagicConstant); } -// workaround expected-note 4 {{marked unavailable here}} expected-note 2 {{property 'prop' is declared unavailable here}} void test7(Test7 *p) { *p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}} p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}} *[p prop] = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}} [p setProp: 0]; // expected-error {{'setProp:' is unavailable: this system declaration uses an unsupported type}} +// expected-note@arc-system-header.h:41 4 {{marked unavailable here}} +// expected-note@arc-system-header.h:41 2 {{property 'prop' is declared unavailable here}} } #endif diff --git a/test/SemaObjC/arc-unavailable-for-weakref.m b/test/SemaObjC/arc-unavailable-for-weakref.m index b140c64..b9b5cc5 100644 --- a/test/SemaObjC/arc-unavailable-for-weakref.m +++ b/test/SemaObjC/arc-unavailable-for-weakref.m @@ -56,9 +56,33 @@ __attribute__((objc_arc_weak_reference_unavailable)) @interface I { } -@property (weak) NSFont *font; // expected-note {{property declared here}} +@property (weak) NSFont *font; // expected-error {{synthesizing __weak instance variable of type 'NSFont *', which does not support weak references}} @end -@implementation I -@synthesize font = _font; // expected-error {{synthesis of a weak-unavailable property is disallowed because it requires synthesis of an instance variable of the __weak object}} +@implementation I // expected-note {{when implemented by class I}} +@synthesize font = _font; +@end + +// rdar://13676793 +@protocol MyProtocol +@property (weak) NSFont *font; // expected-error {{synthesizing __weak instance variable of type 'NSFont *', which does not support weak references}} +@end + +@interface I1 <MyProtocol> +@end + +@implementation I1 // expected-note {{when implemented by class I1}} +@synthesize font = _font; +@end + +@interface Super +@property (weak) NSFont *font; // expected-error {{synthesizing __weak instance variable of type 'NSFont *', which does not support weak references}} +@end + + +@interface I2 : Super +@end + +@implementation I2 // expected-note {{when implemented by class I2}} +@synthesize font = _font; @end diff --git a/test/SemaObjC/arc.m b/test/SemaObjC/arc.m index d89d035..1d4e42d 100644 --- a/test/SemaObjC/arc.m +++ b/test/SemaObjC/arc.m @@ -756,3 +756,14 @@ void rdar12569201(id key, id value) { @interface C - (void)method:(id[])objects; // expected-error{{must explicitly describe intended ownership of an object array parameter}} @end + +// rdar://13752880 +@interface NSMutableArray : NSArray @end + +typedef __strong NSMutableArray * PSNS; + +void test(NSArray *x) { + NSMutableArray *y = x; // expected-warning {{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}} + __strong NSMutableArray *y1 = x; // expected-warning {{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}} + PSNS y2 = x; // expected-warning {{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}} +} diff --git a/test/SemaObjC/attr-availability.m b/test/SemaObjC/attr-availability.m index bf7ef19..fddcd50 100644 --- a/test/SemaObjC/attr-availability.m +++ b/test/SemaObjC/attr-availability.m @@ -17,7 +17,7 @@ // rdar://11475360 @interface B : A -- (void)method; // expected-note {{method 'method' declared here}} +- (void)method; // NOTE: we expect 'method' to *not* inherit availability. - (void)overridden __attribute__((availability(macosx,introduced=10.4))); // expected-warning{{overriding method introduced after overridden method on OS X (10.4 vs. 10.3)}} - (void)overridden2 __attribute__((availability(macosx,introduced=10.2))); - (void)overridden3 __attribute__((availability(macosx,deprecated=10.4))); @@ -28,7 +28,35 @@ void f(A *a, B *b) { [a method]; // expected-warning{{'method' is deprecated: first deprecated in OS X 10.2}} - [b method]; // expected-warning {{'method' is deprecated: first deprecated in OS X 10.2}} + [b method]; // no-warning [a proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in OS X 10.2}} [b proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in OS X 10.2}} } + +// Test case for <rdar://problem/11627873>. Warn about +// using a deprecated method when that method is re-implemented in a +// subclass where the redeclared method is not deprecated. +@interface C +- (void) method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}} +@end + +@interface D : C +- (void) method; +@end + +@interface E : D +- (void) method; +@end + +@implementation D +- (void) method { + [super method]; // expected-warning {{'method' is deprecated: first deprecated in OS X 10.2}} +} +@end + +@implementation E +- (void) method { + [super method]; // no-warning +} +@end + diff --git a/test/SemaObjC/warn-isa-ref.m b/test/SemaObjC/deprecated-objc-introspection.m index b1ffb4f..faaef25 100644 --- a/test/SemaObjC/warn-isa-ref.m +++ b/test/SemaObjC/deprecated-objc-introspection.m @@ -1,4 +1,10 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s + +//====------------------------------------------------------------====// +// Test deprecated direct usage of the 'isa' pointer. +//====------------------------------------------------------------====// + +typedef unsigned long NSUInteger; typedef struct objc_object { struct objc_class *isa; @@ -81,3 +87,11 @@ static void func() { } @end +// Test for introspection of Objective-C pointers via bitmasking. + +void testBitmasking(NSObject *p) { + (void) (((NSUInteger) p) & 0x1); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}} + (void) (0x1 & ((NSUInteger) p)); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}} + (void) (((NSUInteger) p) ^ 0x1); // no-warning + (void) (0x1 ^ ((NSUInteger) p)); // no-warning +}
\ No newline at end of file diff --git a/test/SemaObjC/format-arg-attribute.m b/test/SemaObjC/format-arg-attribute.m index 6edb8fd..dede433 100644 --- a/test/SemaObjC/format-arg-attribute.m +++ b/test/SemaObjC/format-arg-attribute.m @@ -14,7 +14,7 @@ union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'form enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}} extern NSString *ff3 (const NSString *) __attribute__((format_arg(3-2))); -extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{attribute takes one argument}} +extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{use of undeclared identifier 'foo'}} /* format_arg formats must take and return a string. */ extern NSString *fi0 (int) __attribute__((format_arg(1))); // expected-error {{format argument not a string type}} diff --git a/test/SemaObjC/format-strings-objc.m b/test/SemaObjC/format-strings-objc.m index bd33ad4..8490130 100644 --- a/test/SemaObjC/format-strings-objc.m +++ b/test/SemaObjC/format-strings-objc.m @@ -13,6 +13,7 @@ typedef signed char BOOL; typedef unsigned int NSUInteger; +typedef long NSInteger; @class NSString, Protocol; extern void NSLog(NSString *format, ...); extern void NSLogv(NSString *format, va_list args); @@ -235,3 +236,8 @@ void testByValueObjectInFormat(Foo *obj) { [Bar log2:@"%d", *obj]; // expected-error {{cannot pass object with interface type 'Foo' by value to variadic method; expected type from format string was 'int'}} } +// <rdar://problem/13557053> +void testTypeOf(NSInteger dW, NSInteger dH) { + NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} +} + diff --git a/test/SemaObjC/message.m b/test/SemaObjC/message.m index f43bdf9..40fa102 100644 --- a/test/SemaObjC/message.m +++ b/test/SemaObjC/message.m @@ -106,3 +106,15 @@ void foo5(id p) { // expected-note {{to match this '['}} \ // expected-warning {{instance method '-bar' not found}} } + +@interface I1 +-(void)unavail_meth __attribute__((unavailable)); // expected-note {{marked unavailable here}} +@end + +// rdar://13620447 +void foo6(I1 *p) { + [p + bar]; // expected-warning {{instance method '-bar' not found}} + [p + unavail_meth]; // expected-error {{unavailable}} +} diff --git a/test/SemaObjC/method-conflict-2.m b/test/SemaObjC/method-conflict-2.m index df59f24..ec80a43 100644 --- a/test/SemaObjC/method-conflict-2.m +++ b/test/SemaObjC/method-conflict-2.m @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -x objective-c++ -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s @interface A @end @interface B : A @end @@ -42,3 +43,24 @@ - (A*) test1 { return 0; } // id -> A* is rdar://problem/8596987 - (id) test2 { return 0; } @end + +// rdar://12522752 +typedef int int32_t; +typedef long long int64_t; + +@interface NSObject @end + +@protocol CKMessage +@property (nonatomic,readonly,assign) int64_t sequenceNumber; // expected-note {{previous definition is here}} +@end + +@protocol CKMessage; + +@interface CKIMMessage : NSObject<CKMessage> +@end + +@implementation CKIMMessage +- (int32_t)sequenceNumber { // expected-warning {{conflicting return type in implementation of 'sequenceNumber': 'int64_t' (aka 'long long') vs 'int32_t' (aka 'int')}} + return 0; +} +@end diff --git a/test/SemaObjC/property-category-4.m b/test/SemaObjC/property-category-4.m index e7939b3..ccf5e9b 100644 --- a/test/SemaObjC/property-category-4.m +++ b/test/SemaObjC/property-category-4.m @@ -16,3 +16,108 @@ @dynamic d_selectedObjects; // expected-error {{property declared in category 'CAT' cannot be implemented in class implementation}} @end + +// rdar://13713098 +// Test1 +@interface NSArray +- (int)count; +@end + +@protocol MyCountable +@property (readonly) int count; +@end + + +@interface NSArray(Additions) <MyCountable> +@end + +@implementation NSArray(Additions) +@end + +// Test2 +@protocol NSProtocol +- (int)count; +@end + +@interface NSArray1 <NSProtocol> +@end + +@interface NSArray1(Additions) <MyCountable> +@end + +@implementation NSArray1(Additions) +@end + +// Test3 +@interface Super <NSProtocol> +@end + +@interface NSArray2 : Super @end + +@interface NSArray2(Additions) <MyCountable> +@end + +@implementation NSArray2(Additions) +@end + +// Test3 +@interface Super1 <NSProtocol> +@property (readonly) int count; +@end + +@protocol MyCountable1 +@end + +@interface NSArray3 : Super1 <MyCountable1> +@end + +@implementation NSArray3 +@end + +// Test4 +@interface I +@property int d1; +@end + +@interface I(CAT) +@property int d1; +@end + +@implementation I(CAT) +@end + +// Test5 +@interface C @end + +@interface C (CAT) +- (int) p; +@end + + +@interface C (Category) +@property (readonly) int p; // no warning for this property - a getter is declared in another category +@property (readonly) int p1; // expected-note {{property declared here}} +@property (readonly) int p2; // no warning for this property - a getter is declared in this category +- (int) p2; +@end + +@implementation C (Category) // expected-warning {{property 'p1' requires method 'p1' to be defined - use @dynamic or provide a method implementation in this category}} +@end + +// Test6 +@protocol MyProtocol +@property (readonly) float anotherFloat; // expected-note {{property declared here}} +@property (readonly) float Float; // no warning for this property - a getter is declared in this protocol +- (float) Float; +@end + +@interface MyObject +{ float anotherFloat; } +@end + +@interface MyObject (CAT) <MyProtocol> +@end + +@implementation MyObject (CAT) // expected-warning {{property 'anotherFloat' requires method 'anotherFloat' to be defined - use @dynamic or provide a method implementation in this category}} +@end + diff --git a/test/SemaObjC/property-category-impl.m b/test/SemaObjC/property-category-impl.m index be42dea..135b005 100644 --- a/test/SemaObjC/property-category-impl.m +++ b/test/SemaObjC/property-category-impl.m @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// expected-no-diagnostics /* This test is for categories which don't implement the accessors but some accessors are implemented in their base class implementation. In this case,no warning must be issued. @@ -24,10 +25,10 @@ @end @interface MyClass (public) -@property(readwrite) int foo; // expected-note {{property declared here}} +@property(readwrite) int foo; @end -@implementation MyClass (public)// expected-warning {{property 'foo' requires method 'setFoo:' to be defined }} +@implementation MyClass (public) @end // rdar://12568064 diff --git a/test/SemaObjC/property-deprecated-warning.m b/test/SemaObjC/property-deprecated-warning.m index aa7b764..7e10356 100644 --- a/test/SemaObjC/property-deprecated-warning.m +++ b/test/SemaObjC/property-deprecated-warning.m @@ -5,37 +5,51 @@ typedef signed char BOOL; @protocol P -@property(nonatomic,assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note 2 {{property 'ptarget' is declared deprecated here}} +@property(nonatomic,assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'ptarget' is declared deprecated here}} expected-note {{method 'ptarget' declared here}} @end @protocol P1<P> -- (void)setPtarget:(id)arg; // expected-note {{method 'setPtarget:' declared here}} +- (void)setPtarget:(id)arg; @end @interface UITableViewCell<P1> -@property(nonatomic,assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'target' is declared deprecated here}} +@property(nonatomic,assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'target' is declared deprecated here}} expected-note {{method 'setTarget:' declared here}} @end @interface PSTableCell : UITableViewCell - - (void)setTarget:(id)target; // expected-note {{method 'setTarget:' declared here}} + - (void)setTarget:(id)target; @end @interface UITableViewCell(UIDeprecated) -@property(nonatomic,assign) id dep_target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{method 'dep_target' declared here}} \ - // expected-note 2 {{property 'dep_target' is declared deprecated here}} \ - // expected-note {{method 'setDep_target:' declared here}} +@property(nonatomic,assign) id dep_target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note 2 {{method 'dep_target' declared here}} \ + // expected-note 4 {{property 'dep_target' is declared deprecated here}} \ + // expected-note 2 {{method 'setDep_target:' declared here}} @end @implementation PSTableCell - (void)setTarget:(id)target {}; - (void)setPtarget:(id)val {}; - (void) Meth { + [self setTarget: (id)0]; // no-warning + [self setDep_target: [self dep_target]]; // expected-warning {{'dep_target' is deprecated: first deprecated in iOS 3.0}} \ + // expected-warning {{'setDep_target:' is deprecated: first deprecated in iOS 3.0}} + + [self setPtarget: (id)0]; // no-warning +} +@end + +@implementation UITableViewCell +@synthesize target; +@synthesize ptarget; +- (void)setPtarget:(id)val {}; +- (void)setTarget:(id)target {}; +- (void) Meth { [self setTarget: (id)0]; // expected-warning {{'setTarget:' is deprecated: first deprecated in iOS 3.0}} [self setDep_target: [self dep_target]]; // expected-warning {{'dep_target' is deprecated: first deprecated in iOS 3.0}} \ // expected-warning {{'setDep_target:' is deprecated: first deprecated in iOS 3.0}} - [self setPtarget: (id)0]; // expected-warning {{setPtarget:' is deprecated: first deprecated in iOS 3.0}} + [self setPtarget: (id)0]; // no-warning } @end @@ -56,9 +70,11 @@ void testCustomAccessorNames(CustomAccessorNames *obj) { @end @interface ProtocolInCategory (TheCategory) <P1> -- (id)ptarget; // expected-note {{method 'ptarget' declared here}} +- (id)ptarget; @end -id useDeprecatedProperty(ProtocolInCategory *obj) { - return [obj ptarget]; // expected-warning {{'ptarget' is deprecated: first deprecated in iOS 3.0}} +id useDeprecatedProperty(ProtocolInCategory *obj, id<P> obj2, int flag) { + if (flag) + return [obj ptarget]; // no-warning + return [obj2 ptarget]; // expected-warning {{'ptarget' is deprecated: first deprecated in iOS 3.0}} } diff --git a/test/SemaObjC/property-noninherited-availability-attr.m b/test/SemaObjC/property-noninherited-availability-attr.m index 79cdd3e..0c2a5d3 100644 --- a/test/SemaObjC/property-noninherited-availability-attr.m +++ b/test/SemaObjC/property-noninherited-availability-attr.m @@ -5,7 +5,8 @@ @interface NSObject @end @protocol myProtocol -@property int myProtocolProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); +@property int myProtocolProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); // expected-note {{method 'myProtocolProperty' declared here}} \ + // expected-note {{property 'myProtocolProperty' is declared deprecated here}} @end @interface Foo : NSObject @@ -15,18 +16,19 @@ @end @interface Bar : Foo <myProtocol> -@property int myProperty; // expected-note {{'myProperty' declared here}} -@property int myProtocolProperty; // expected-note {{'myProtocolProperty' declared here}} +@property int myProperty; +@property int myProtocolProperty; @end -void test(Foo *y, Bar *x) { +void test(Foo *y, Bar *x, id<myProtocol> z) { y.myProperty = 0; // expected-warning {{'myProperty' is deprecated: first deprecated in OS X 10.8}} [y myProperty]; // expected-warning {{'myProperty' is deprecated: first deprecated in OS X 10.8}} x.myProperty = 1; // no-warning - [x myProperty]; // expected-warning {{'myProperty' is deprecated: first deprecated in OS X 10.8}} + [x myProperty]; // no-warning x.myProtocolProperty = 0; // no-warning - [x myProtocolProperty]; // expected-warning {{'myProtocolProperty' is deprecated: first deprecated in OS X 10.8}} + [x myProtocolProperty]; // no-warning + [z myProtocolProperty]; // expected-warning {{'myProtocolProperty' is deprecated: first deprecated in OS X 10.8}} } diff --git a/test/SemaObjC/property-user-setter.m b/test/SemaObjC/property-user-setter.m index cda983c..e84fad2 100644 --- a/test/SemaObjC/property-user-setter.m +++ b/test/SemaObjC/property-user-setter.m @@ -85,7 +85,7 @@ static int g_val; - (void)setFoo:(int)value; @end -void g(int); // expected-note {{passing argument to parameter here}} +void g(int); void f(C *c) { c.Foo = 17; // OK diff --git a/test/SemaObjC/property.m b/test/SemaObjC/property.m index 76fdf5b..7485447 100644 --- a/test/SemaObjC/property.m +++ b/test/SemaObjC/property.m @@ -11,7 +11,7 @@ @end @interface I(CAT) -@property int d1; // expected-note 2 {{property declared here}} +@property int d1; @end @implementation I @@ -22,8 +22,7 @@ @synthesize name; // OK! property with same name as an accessible ivar of same name @end -@implementation I(CAT) // expected-warning {{property 'd1' requires method 'd1' to be defined }} \ - // expected-warning {{property 'd1' requires method 'setD1:' to be defined }} +@implementation I(CAT) @synthesize d1; // expected-error {{@synthesize not allowed in a category's implementation}} @dynamic bad; // expected-error {{property implementation must have its declaration in the category 'CAT'}} @end diff --git a/test/SemaObjC/protocol-lookup-2.m b/test/SemaObjC/protocol-lookup-2.m index 9e8ed8a..90f6db0 100644 --- a/test/SemaObjC/protocol-lookup-2.m +++ b/test/SemaObjC/protocol-lookup-2.m @@ -32,3 +32,26 @@ } @end + + +@protocol ProtC +-document; +@end + +@interface I1 : NSObject +@end + +@interface I1(cat) +-document; +@end + +@interface I2 : NSObject +-document; +@end + +@interface I2() <ProtC> +@end + +@implementation I2 +- document { return 0; } +@end diff --git a/test/SemaObjC/typo-correction.m b/test/SemaObjC/typo-correction.m index 3fd61e2..893e312 100644 --- a/test/SemaObjC/typo-correction.m +++ b/test/SemaObjC/typo-correction.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -verify -fsyntax-only -fwarn-on-spellcheck +// RUN: %clang_cc1 %s -verify -fsyntax-only @interface B @property int x; @@ -8,8 +8,7 @@ @end // Spell-checking 'undefined' is ok. -undefined var; // expected-warning {{spell-checking initiated}} \ - // expected-error {{unknown type name}} +undefined var; // expected-error {{unknown type name}} typedef int super1; @implementation S diff --git a/test/SemaObjC/warn-missing-super.m b/test/SemaObjC/warn-missing-super.m index 02b8165..e9769a9 100644 --- a/test/SemaObjC/warn-missing-super.m +++ b/test/SemaObjC/warn-missing-super.m @@ -54,5 +54,5 @@ __attribute__((objc_root_class)) // CHECK-GC-ONLY: 1 warning generated. // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s -// CHECK-ARC: warn-missing-super.m:36:4: error: ARC forbids explicit message send of 'dealloc' +// CHECK-ARC: warn-missing-super.m:36:10: error: ARC forbids explicit message send of 'dealloc' // CHECK-ARC: 1 error generated. |