2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s
|
2007-12-12 14:22:14 +08:00
|
|
|
|
2007-11-10 03:52:12 +08:00
|
|
|
@interface foo
|
|
|
|
- (int)meth;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation foo
|
|
|
|
- (int) meth { return [self meth]; }
|
|
|
|
@end
|
|
|
|
|
2008-08-23 09:48:03 +08:00
|
|
|
// PR2708
|
|
|
|
@interface MyClass
|
|
|
|
+- (void)myMethod; // expected-error {{expected selector for Objective-C method}}
|
|
|
|
- (vid)myMethod2; // expected-error {{expected a type}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
- (void)myMethod { }
|
2008-12-05 09:35:25 +08:00
|
|
|
- (vid)myMethod2 { } // expected-error {{expected a type}}
|
2009-04-12 03:58:42 +08:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@protocol proto;
|
|
|
|
@protocol NSObject;
|
|
|
|
|
|
|
|
//@protocol GrowlPluginHandler <NSObject> @end
|
|
|
|
|
|
|
|
|
|
|
|
@interface SomeClass2
|
|
|
|
- (int)myMethod1: (id<proto>)
|
|
|
|
arg; // expected-note {{previous definition is here}}
|
2008-08-23 09:48:03 +08:00
|
|
|
@end
|
|
|
|
|
2009-04-12 03:58:42 +08:00
|
|
|
@implementation SomeClass2
|
|
|
|
- (int)myMethod1: (id<NSObject>)
|
|
|
|
arg { // expected-warning {{conflicting parameter types in implementation of 'myMethod1:': 'id<proto>' vs 'id<NSObject>'}}
|
|
|
|
|
|
|
|
}
|
|
|
|
@end
|