39 lines · plain
1// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s2 3@interface SUPER4- (int) meth;5+ (int) foobar;6@end7 8@interface T @end9 10@interface class1 : SUPER11- (int) meth; // expected-note {{previous declaration is here}}12- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}13- (T*) meth1; // expected-note {{previous declaration is here}}14- (T*) meth1; // expected-warning {{multiple declarations of method 'meth1' found and ignored}}15+ (T*) meth1;16@end17 18@interface class1(cat)19- (int) catm : (char)ch1; // expected-note {{previous declaration is here}}20- (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@end25 26@interface class1(cat1)27+ (int) catm1 : (char)ch : (int)i; // expected-note {{previous declaration is here}}28+ (T*) meth1; // expected-note {{previous declaration is here}}29+ (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@end33 34@protocol P35- (int) meth; // expected-note {{previous declaration is here}}36- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}37@end38 39