blob: 985a4c147f9766cd2de562359a2d18ee395749b8 [file] [log] [blame]
Fariborz Jahanian85ff2642007-10-05 18:00:57 +00001// RUN: clang -fsyntax-only -verify %s
2
3@interface SUPER
4- (int) meth;
5+ (int) foobar;
6@end
7
8@interface T @end
9
10@interface class1 : SUPER
Chris Lattner5f4a6822008-11-23 23:12:31 +000011- (int) meth; // expected-note {{previous declaration is here}}
Fariborz Jahanian85ff2642007-10-05 18:00:57 +000012- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
13- (T*) meth1;
14- (T*) meth1;
15+ (T*) meth1;
16@end
17
18@interface class1(cat)
Chris Lattner5f4a6822008-11-23 23:12:31 +000019- (int) catm : (char)ch1; // expected-note {{previous declaration is here}}
Fariborz Jahanian85ff2642007-10-05 18:00:57 +000020- (int) catm1 : (char)ch : (int)i;
21- (int) catm : (char*)ch1; // expected-error {{duplicate declaration of method 'catm:'}}
22+ (int) catm1 : (char)ch : (int)i;
23+ (T*) meth1;
24@end
25
26@interface class1(cat1)
Chris Lattner5f4a6822008-11-23 23:12:31 +000027+ (int) catm1 : (char)ch : (int)i; // expected-note {{previous declaration is here}}
28+ (T*) meth1; // expected-note {{previous declaration is here}}
Fariborz Jahanian85ff2642007-10-05 18:00:57 +000029+ (int) catm1 : (char)ch : (int*)i; // expected-error {{duplicate declaration of method 'catm1::'}}
30+ (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}}
31+ (int) foobar;
32@end
Steve Naroff8f744762007-10-12 18:49:25 +000033
34@protocol P
Chris Lattner5f4a6822008-11-23 23:12:31 +000035- (int) meth; // expected-note {{previous declaration is here}}
Fariborz Jahanian1109b422007-10-12 23:43:31 +000036- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
Steve Naroff8f744762007-10-12 18:49:25 +000037@end
38