blob: bc7ea7bc449c9f0f8f5a51a0ae86f7f11193df34 [file] [log] [blame]
John McCall10302c02010-10-28 02:34:38 +00001// RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify %s
Chris Lattnera027b862007-12-12 06:22:14 +00002
Fariborz Jahanian1f7b6f82007-11-09 19:52:12 +00003@interface foo
4- (int)meth;
5@end
6
7@implementation foo
8- (int) meth { return [self meth]; }
9@end
10
Chris Lattnere8904e92008-08-23 01:48:03 +000011// PR2708
12@interface MyClass
13+- (void)myMethod; // expected-error {{expected selector for Objective-C method}}
14- (vid)myMethod2; // expected-error {{expected a type}}
15@end
16
17@implementation MyClass
18- (void)myMethod { }
Fariborz Jahaniande739412008-12-05 01:35:25 +000019- (vid)myMethod2 { } // expected-error {{expected a type}}
Chris Lattner3aff9192009-04-11 19:58:42 +000020
Chris Lattnere8904e92008-08-23 01:48:03 +000021@end
22
Chris Lattner3aff9192009-04-11 19:58:42 +000023
24@protocol proto;
25@protocol NSObject;
26
27//@protocol GrowlPluginHandler <NSObject> @end
28
29
30@interface SomeClass2
31- (int)myMethod1: (id<proto>)
32arg; // expected-note {{previous definition is here}}
33@end
34
35@implementation SomeClass2
36- (int)myMethod1: (id<NSObject>)
37 arg { // expected-warning {{conflicting parameter types in implementation of 'myMethod1:': 'id<proto>' vs 'id<NSObject>'}}
38
39}
40@end