2009-12-14 20:36:25 +03:00
|
|
|
// RUN: clang -cc1 -fsyntax-only -verify %s
|
2007-12-12 09:22:14 +03:00
|
|
|
|
2007-11-09 22:52:12 +03:00
|
|
|
@interface foo
|
|
|
|
- (int)meth;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation foo
|
|
|
|
- (int) meth { return [self meth]; }
|
|
|
|
@end
|
|
|
|
|
2008-08-23 05:48:03 +04: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 04:35:25 +03:00
|
|
|
- (vid)myMethod2 { } // expected-error {{expected a type}}
|
2009-04-11 23:58:42 +04: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 05:48:03 +04:00
|
|
|
@end
|
|
|
|
|
2009-04-11 23:58:42 +04:00
|
|
|
@implementation SomeClass2
|
|
|
|
- (int)myMethod1: (id<NSObject>)
|
|
|
|
arg { // expected-warning {{conflicting parameter types in implementation of 'myMethod1:': 'id<proto>' vs 'id<NSObject>'}}
|
|
|
|
|
|
|
|
}
|
|
|
|
@end
|