blob: 6c382d8cd956cbd26c7f574cba16a418d14db700 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahaniana8ef2ec2008-12-05 18:38:31 +00002
Fariborz Jahanian8daab972008-12-05 18:18:52 +00003@interface A
4- (void) setMoo: (int) x; // expected-note {{previous definition is here}}
5- (int) setMoo1: (int) x; // expected-note {{previous definition is here}}
6- (int) setOk : (int) x : (double) d;
7@end
8
9@implementation A
Chris Lattner3aff9192009-04-11 19:58:42 +000010-(void) setMoo: (float) x {} // expected-warning {{conflicting parameter types in implementation of 'setMoo:': 'int' vs 'float'}}
Mike Stumpd1969d82009-07-22 00:43:08 +000011- (char) setMoo1: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'setMoo1:': 'int' vs 'char'}}
12- (int) setOk : (int) x : (double) d { return 0; }
Fariborz Jahanian8daab972008-12-05 18:18:52 +000013@end
14
15
16
17@interface C
Chris Lattner3aff9192009-04-11 19:58:42 +000018+ (void) cMoo: (int) x; // expected-note 2 {{previous definition is here}}
Fariborz Jahanian8daab972008-12-05 18:18:52 +000019@end
20
21@implementation C
Chris Lattner3aff9192009-04-11 19:58:42 +000022+(float) cMoo: // expected-warning {{conflicting return type in implementation of 'cMoo:': 'void' vs 'float'}}
Mike Stumpd1969d82009-07-22 00:43:08 +000023 (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'cMoo:': 'int' vs 'float'}}
Fariborz Jahanian8daab972008-12-05 18:18:52 +000024@end
25
26
27@interface A(CAT)
Chris Lattner3aff9192009-04-11 19:58:42 +000028- (void) setCat: (int) x; // expected-note 2 {{previous definition is here}}
Fariborz Jahanian8daab972008-12-05 18:18:52 +000029+ (void) cCat: (int) x; // expected-note {{previous definition is here}}
30@end
31
32@implementation A(CAT)
Chris Lattner3aff9192009-04-11 19:58:42 +000033-(float) setCat: // expected-warning {{conflicting return type in implementation of 'setCat:': 'void' vs 'float'}}
Mike Stumpd1969d82009-07-22 00:43:08 +000034(float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}}
35+ (int) cCat: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}}
Fariborz Jahanian8daab972008-12-05 18:18:52 +000036@end